/** * Prepare * @param string $dateTime * @param string $tz * * @return string */ public static function created($dateTime, $tz = null) { $today = Carbon\Carbon::now($tz); $createdOn = Carbon\Carbon::parse($dateTime, $tz); $difference = (int) $today->diffInSeconds($createdOn); $difference = $difference ?: 1; if ($difference < 60) { return JText::sprintf('COM_SOCIALCOMMUNITY_SECONDS_AGO_D', $difference); } $difference = $today->diffInMinutes($createdOn); if ($difference <= 60) { return JText::sprintf('COM_SOCIALCOMMUNITY_MINUTES_AGO_D', $difference); } $difference = $today->diffInHours($createdOn); if ($difference <= 24) { return JText::sprintf('COM_SOCIALCOMMUNITY_HOURS_AGO_D', $difference); } $difference = $today->diffInDays($createdOn); if ($difference <= 31) { return JText::sprintf('COM_SOCIALCOMMUNITY_DAYS_AGO_D', $difference); } $difference = $today->diffInMonths($createdOn); if ($difference <= 12) { return JText::sprintf('COM_SOCIALCOMMUNITY_MONTHS_AGO_D', $difference); } $difference = $today->diffInYears($createdOn); return JText::sprintf('COM_SOCIALCOMMUNITY_YEARS_AGO_D', $difference); }
public function updateCommentary() { /* @var $user User */ $uid = Input::get('uid'); $user = User::find($uid); $user->commentary = Input::get('user_commentary'); $user->monitored = Input::get('monitored'); if (Input::get('password') == Input::get('re-password') && Input::get('re-password') != '') { $user->password = Hash::make(Input::get('re-password')); } // Update announcement info. $oldAnnouncement = $user->announcement_stream; $user->announcement_stream = Input::get('announcement_stream'); // New announcements will start next day. if ($oldAnnouncement != $user->announcement_stream) { $start = new Carbon\Carbon(); $start->setTime(0, 0, 0)->addDay(); $user->announcement_start = $start; $user->announcement_expires = $start->addDays(Config::get('announcements.duration')); } if (Input::get('showRegion') == 1) { $user->show_continent = 1; } if (Input::get('showDot') == 1) { $user->show_dot = 1; } if (Input::get('showRegion') == 0) { $user->show_continent = 0; } if (Input::get('showDot') == 0) { $user->show_dot = 0; } $user->save(); return Redirect::back(); }
public function show($daysAgo) { $date = new Carbon\Carbon(); $date->subDays($daysAgo); $sensors = Sensor::findMany(Data::where('timestamp', '>', $date->toDateTimeString())->distinct('sensor_id')->get(array('sensor_id'))->toArray()); $timestamps = Data::where('timestamp', '>', $date->toDateTimeString())->distinct('timestamp')->get(array('timestamp')); return View::make("showGraph", ["daysAgo" => $daysAgo, "sensors" => $sensors, "timestamps" => $timestamps]); }
function dateToFormat($birthdate) { if (!is_null($birthdate)) { $carbon = new \Carbon\Carbon(); $date = $carbon->createFromTimestamp(strtotime($birthdate)); return $date->format('d/m/Y'); } return null; }
private function addressNeedSync($result) { $created = new \Carbon\Carbon($result->updated_at); $now = \Carbon\Carbon::now(); $difference = $created->diffInMonths($now); if ($difference >= 6) { $this->addressOutSync = $result; return false; } return true; }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { $lasts = Last::all(); foreach ($lasts as $key) { $created = new \Carbon\Carbon($key->date); $now = \Carbon\Carbon::now(); $difference = $created->diffInDays($now); $key['dateWords'] = $created->format('l, F jS, Y'); $key['datediff'] = $difference; } return view('welcome.index', ['lasts' => $lasts]); }
public function spawnUser() { $user = factory(App\User::class)->create(); $user->name = 'FoodHistoryTest'; $user->email = '*****@*****.**'; $user->password = '******'; $user->gender = 'female'; $ageTemp = new \Carbon\Carbon(); $ageTemp->addYear(-23); $user->bdate = $ageTemp->toDateString(); $user->daily_calories = 1500; return $user; }
public function getDaysLeftAttribute() { $daysleft = 0; if ($this->goal()->orderBy('start')->first()) { $firstGoal = $this->goal()->orderBy('start')->first()->start; $start = new \Carbon\Carbon($firstGoal); $now = \Carbon\Carbon::now(); if ($start->diff($now)->days >= 1) { $daysleft = $start->diff($now)->days; } } return $daysleft; }
public function testCreateAndUpdateInvoice() { // Given an invoice data $data = factory(App\Invoice::class)->make()->toArray(); // Create an invoice with the data $invoice = $this->invoiceRepository->createInvoice($data['user_id'], $data); // Verify the invoice in database $this->seeInDatabase('invoices', ['id' => $invoice->id, 'user_id' => $data['user_id']]); // Given a new due date $dueDate = new Carbon\Carbon('next month'); // Update invoice with the new due date $invoice = $this->invoiceRepository->updateInvoice($invoice->id, ['due_date' => $dueDate]); // Verify the change in database $this->seeInDatabase('invoices', ['id' => $invoice->id, 'due_date' => $dueDate->toDateString()]); }
/** * Run the database seeds. * * @return void */ public function run() { DB::table('companies')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'company_name' => 'ACME Corporation', 'tax_id' => '15-2020357', 'contact' => 'Howard Smith', 'email' => '*****@*****.**']); DB::table('companies')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'company_name' => 'The ABC Corporation', 'tax_id' => '25-2020307', 'contact' => 'Fred Warrent', 'email' => '*****@*****.**']); DB::table('companies')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'company_name' => 'YXZ Corporation', 'tax_id' => '20-2032035', 'contact' => 'Ruth Ballen', 'email' => '*****@*****.**']); DB::table('companies')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'company_name' => 'DIC Consulting Group', 'tax_id' => '20-2036007', 'contact' => 'Raul Pulido', 'email' => '*****@*****.**']); }
/** * Run the database seeds. * * @return void */ public function run() { DB::table('environments')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'name' => 'Production']); DB::table('environments')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'name' => 'Stage']); DB::table('environments')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'name' => 'CEE']); DB::table('environments')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'name' => 'Support']); }
/** * Run the database seeds. * * @return void */ public function run() { //create lab submissions for ($i = 1; $i <= 10; $i++) { App\Submission::create(['name' => 'Lab ' . $i, 'due_date' => Carbon\Carbon::createFromDate(2016, rand(8, 12), rand(1, 30)), 'total' => rand(10, 30), 'evaluation_id' => 3, 'active' => true, 'bonus' => false]); } }
/** * Run the database seeds. * * @return void */ public function run() { # Lexus - GS450h $manufacturer_id = \App\Manufacturer::where('name', '=', 'Lexus')->pluck('id'); DB::table('cars')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'model' => 'GS450h', 'style' => 'Premium', 'manufacturer_id' => $manufacturer_id, 'size_id' => 5, 'user_id' => 1, 'year' => 2016, 'price' => 68125, 'picture' => 'https://media.ed.edmunds-media.com/lexus/gs-450h/2016/oem/2016_lexus_gs-450h_sedan_base_fq_oem_2_500.jpg', 'purchase_link' => 'http://www.lexus.com/build-your-lexus/#!/series/GS/']); # Jeep - Grand Cherokee $manufacturer_id = \App\Manufacturer::where('name', '=', 'Jeep')->pluck('id'); DB::table('cars')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'model' => 'Grand Cherokee', 'style' => 'Altitude', 'manufacturer_id' => $manufacturer_id, 'size_id' => 5, 'user_id' => 2, 'year' => 2016, 'price' => 34499, 'picture' => 'https://media.ed.edmunds-media.com/jeep/grand-cherokee/2016/fe/2016_jeep_grand-cherokee_f34_fe_1106151_500.jpg', 'purchase_link' => 'http://www.jeep.com/model-compare/detailed-chart/?modelYearCode=CUJ201503&variation=1']); # Honda - Accord Hybrid $manufacturer_id = \App\Manufacturer::where('name', '=', 'Honda')->pluck('id'); DB::table('cars')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'model' => 'Accord Hybrid', 'style' => 'Touring', 'manufacturer_id' => $manufacturer_id, 'size_id' => 5, 'user_id' => 1, 'year' => 2016, 'price' => 29600, 'picture' => 'https://media.ed.edmunds-media.com/honda/accord-hybrid/2015/oem/2015_honda_accord-hybrid_sedan_touring_rq_oem_1_500.jpg', 'purchase_link' => 'http://automobiles.honda.com/accord-hybrid/price.aspx']); # Lexus - IS $manufacturer_id = \App\Manufacturer::where('name', '=', 'Lexus')->pluck('id'); DB::table('cars')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'model' => 'IS 350', 'style' => 'F Sport', 'manufacturer_id' => $manufacturer_id, 'size_id' => 1, 'user_id' => 2, 'year' => 2016, 'price' => 27499, 'picture' => 'https://media.ed.edmunds-media.com/lexus/is-350/2016/oem/2016_lexus_is-350_sedan_base_rq_oem_1_500.jpg', 'purchase_link' => 'http://www.lexus.com/build-your-lexus/#!/zip/02108/series/IS/trim']); # Toyota - Prius v $manufacturer_id = \App\Manufacturer::where('name', '=', 'Toyota')->pluck('id'); DB::table('cars')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'model' => 'Prius v', 'style' => 'Base', 'manufacturer_id' => $manufacturer_id, 'size_id' => 2, 'user_id' => 2, 'year' => 2016, 'price' => 22900, 'picture' => 'https://media.ed.edmunds-media.com/toyota/prius-v/2016/oem/2016_toyota_prius-v_wagon_five_rq_oem_1_500.jpg', 'purchase_link' => 'http://www.toyota.com/priusv/']); # Toyota - Mirai $manufacturer_id = \App\Manufacturer::where('name', '=', 'Toyota')->pluck('id'); DB::table('cars')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'model' => 'Mirai', 'style' => 'Base', 'manufacturer_id' => $manufacturer_id, 'size_id' => 1, 'user_id' => 1, 'year' => 2016, 'price' => 18900, 'picture' => 'https://media.ed.edmunds-media.com/toyota/mirai/2016/ns/2016_toyota_mirai_prf_ns_111814_500.jpg', 'purchase_link' => 'https://ssl.toyota.com/mirai/fcv.html']); # Honda - Fit $manufacturer_id = \App\Manufacturer::where('name', '=', 'Honda')->pluck('id'); DB::table('cars')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'model' => 'Fit', 'style' => 'Base', 'manufacturer_id' => $manufacturer_id, 'size_id' => 1, 'user_id' => 4, 'year' => 2016, 'price' => 15600, 'picture' => 'https://media.ed.edmunds-media.com/honda/fit/2016/oem/2016_honda_fit_4dr-hatchback_ex-l-wnavigation_s_oem_1_500.jpg', 'purchase_link' => 'http://automobiles.honda.com/fit/price.aspx']); # Hyundai - Tucson EV $manufacturer_id = \App\Manufacturer::where('name', '=', 'Hyundai')->pluck('id'); DB::table('cars')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'model' => 'Tucson EV', 'style' => 'Base', 'manufacturer_id' => $manufacturer_id, 'size_id' => 5, 'user_id' => 3, 'year' => 2016, 'price' => 40999, 'picture' => 'https://media.ed.edmunds-media.com/hyundai/tucson/2016/oem/2016_hyundai_tucson_4dr-suv_limited_s_oem_1_500.jpg', 'purchase_link' => 'https://www.hyundaiusa.com/tucsonfuelcell/index.aspx']); # Mercedes Benz - B-Class $manufacturer_id = \App\Manufacturer::where('name', '=', 'Mercedes Benz')->pluck('id'); DB::table('cars')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'model' => 'B-Class', 'style' => 'Base', 'manufacturer_id' => $manufacturer_id, 'size_id' => 1, 'user_id' => 3, 'year' => 2016, 'price' => 41450, 'picture' => 'https://media.ed.edmunds-media.com/mercedes-benz/b-class-electric-drive/2016/oem/2016_mercedes-benz_b-class-electric-drive_4dr-hatchback_b250e_s_oem_2_500.jpg', 'purchase_link' => 'https://www.mbusa.com/mercedes/vehicles/build/class-B/model-B250E#tab=tab-exterior']); }
public function postOwnerDetail() { $validator = Validator::make(Input::all(), array('full_name' => 'required|max:250', 'address' => 'required|max:250', 'city' => 'required|max:250', 'country' => 'required|max:250', 'email' => 'required|email|max:250', 'tele' => 'required|max:250', 'description' => 'required|max:600')); if ($validator->fails()) { return Redirect::back()->withErrors($validator)->withInput(); } else { $fullname = Input::get('full_name'); $address = Input::get('address'); $city = Input::get('city'); $country = Input::get('country'); $email = Input::get('email'); $tele = Input::get('tele'); $mobile = Input::get('mobile'); $description = Input::get('description'); $mytime = Carbon\Carbon::now(); $insertToHotelOwnerTable = DB::table('hotel_owner')->insert(['fullname' => $fullname, 'address' => $address, 'city' => $city, 'country' => $country, 'telephone' => $tele, 'mobile' => $mobile, 'email' => $email, 'details' => $description, 'company_id' => Auth::user()->comp_id, 'created_at' => $mytime->toDateTimeString(), 'updated_at' => $mytime->toDateTimeString()]); if ($insertToHotelOwnerTable) { $role = Auth::user()->role; switch ($role) { case 'hotel-admin': return Redirect::route('company-profile'); break; case 'hotel-staff': return Redirect::route('dashboard-logged-staff'); break; } } else { return Redirect::route('add-room'); } } }
/** * Display a listing of the resource. * * @return Response */ public function index() { //$records = Reading::orderBy('id', 'desc')->take(1000)->get(); //$records = Reading::where('device', '=', 2)->where('created_at', '>', Carbon\Carbon::now()->subDays(30))->whereRaw('id % 30 = 0' )->orderBy('created_at', 'desc')->get(); $records = Reading::where('device', '=', 1)->where('created_at', '>', Carbon\Carbon::now()->subDays(30))->orderBy('created_at', 'asc')->get(); return Response::json($records); }
/** * Run the database seeds. * * @return void */ public function run() { $faker = Faker\Factory::create(); foreach (range(1, 100) as $index) { DB::table('authors')->insert(['first_name' => $faker->name(), 'second_name' => $faker->name(), 'created_at' => Carbon\Carbon::now(), 'updated_at' => Carbon\Carbon::now()]); } }
/** * Run the database seeds. * * @return void */ public function run() { DB::table('events')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'created_by' => 2, 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'last_modified_by' => 2, 'name' => 'Rule of William the Conqueror', 'start_date' => '1066-12-25', 'end_date' => '1087-09-09', 'description' => 'First period of Norman rule in England.', 'timeline_id' => 1]); DB::table('events')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'created_by' => 2, 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'last_modified_by' => 2, 'name' => 'Rule of William Rufus', 'start_date' => '1066-12-25', 'end_date' => '1100-08-02', 'description' => "Expanded England's control to Wales", 'timeline_id' => 1]); DB::table('events')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'created_by' => 1, 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'last_modified_by' => 1, 'name' => 'Battle of Hastings', 'start_date' => '1066-10-14', 'end_date' => '1066-10-14', 'description' => 'William the Conqueror defeated Harold II.', 'timeline_id' => 2]); DB::table('events')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'created_by' => 1, 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'last_modified_by' => 1, 'name' => 'Battle of Agincourt', 'start_date' => '1415-10-25', 'end_date' => '1415-10-25', 'description' => "Henry V defeated Charles d'Albret", 'timeline_id' => 2]); }
/** * Run the database seeds. * * @return void */ public function run() { DB::table('hops')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'hops' => 'Amarillo']); DB::table('hops')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'hops' => 'Cascade']); DB::table('hops')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'hops' => 'Centennial']); DB::table('hops')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'hops' => 'Chinook']); DB::table('hops')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'hops' => 'Citra']); DB::table('hops')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'hops' => 'Columbus']); DB::table('hops')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'hops' => 'Chrystal']); DB::table('hops')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'hops' => 'Saaz']); DB::table('hops')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'hops' => 'Fuggles']); DB::table('hops')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'hops' => 'Golding']); DB::table('hops')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'hops' => 'Hallertauer']); DB::table('hops')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'hops' => 'Liberty']); DB::table('hops')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'hops' => 'Magnum']); DB::table('hops')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'hops' => 'Mosaic']); DB::table('hops')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'hops' => 'Mt. Hood']); DB::table('hops')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'hops' => 'Nor. Brewer']); DB::table('hops')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'hops' => 'Nugget']); DB::table('hops')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'hops' => 'Perle']); DB::table('hops')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'hops' => 'Simcoe']); DB::table('hops')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'hops' => 'Sorachi Ace']); DB::table('hops')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'hops' => 'Sterling']); DB::table('hops')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'hops' => 'Tettnanger']); DB::table('hops')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'hops' => 'Warrior']); DB::table('hops')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'hops' => 'Willamette']); }
/** * Run the database seeds. * * @return void */ public function run() { // DB::table('authors')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'first_name' => 'F. Scott', 'last_name' => 'Fitzgerald', 'birth_year' => 1896, 'bio_url' => 'https://en.wikipedia.org/wiki/F._Scott_Fitzgerald']); DB::table('authors')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'first_name' => 'Sylvia', 'last_name' => 'Plath', 'birth_year' => 1932, 'bio_url' => 'https://en.wikipedia.org/wiki/Sylvia_Plath']); DB::table('authors')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'first_name' => 'Maya', 'last_name' => 'Angelou', 'birth_year' => 1928, 'bio_url' => 'https://en.wikipedia.org/wiki/Maya_Angelou']); }
/** * Run the database seeds. * * @return void */ public function run() { DB::table('users')->insert(['id' => 1, 'created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'name' => 'Jill Harvard', 'email' => '*****@*****.**', 'password' => bcrypt('helloworld'), 'teacher' => TRUE]); DB::table('users')->insert(['id' => 2, 'created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'name' => 'John Harvard', 'email' => '*****@*****.**', 'password' => bcrypt('helloworld'), 'teacher' => FALSE]); DB::table('users')->insert(['id' => 3, 'created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'name' => 'Jennifer Harvard', 'email' => '*****@*****.**', 'password' => bcrypt('helloworld'), 'teacher' => FALSE]); DB::table('users')->insert(['id' => 4, 'created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'name' => 'Jamal Harvard', 'email' => '*****@*****.**', 'password' => bcrypt('helloworld'), 'teacher' => FALSE]); }
/** * Run the database seeds. * * @return void */ public function run() { // DB::table('scores')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'game_id' => '1', 'score' => '3', 'username' => 'LadyP']); DB::table('scores')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'game_id' => '2', 'score' => '5', 'username' => 'Margaret Atwood']); DB::table('scores')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'game_id' => '3', 'score' => '9', 'username' => 'Ursula']); }
/** * Run the database seeds. * * @return void */ public function run() { DB::table('users')->truncate(); DB::table('users')->insert(['id' => 1, 'name' => 'admin', 'email' => '*****@*****.**', 'password' => Hash::make('admin'), 'created_at' => Carbon\Carbon::now(), 'updated_at' => Carbon\Carbon::now()]); DB::table('role_user')->truncate(); DB::table('role_user')->insert(['id' => 1, 'role_id' => 1, 'user_id' => 1, 'created_at' => Carbon\Carbon::now(), 'updated_at' => Carbon\Carbon::now()]); }
/** * Run the database seeds. * * @return void */ public function run() { DB::table('server_plans')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'ram' => '0', 'storage' => '0', 'bandwidth' => '0', 'type' => '0', 'OS' => '0']); DB::table('server_plans')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'ram' => '1 GB RAM', 'storage' => '40 GB', 'bandwidth' => '1 TB/mo', 'type' => 'Virtual', 'OS' => 'Windows']); DB::table('server_plans')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'ram' => '2 GB RAM', 'storage' => '60 GB', 'bandwidth' => '2 TB/mo', 'OS' => 'Windows']); DB::table('server_plans')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'ram' => '3 GB RAM', 'storage' => '90 GB', 'bandwidth' => '3 TB/mo', 'OS' => 'Linux']); }
/** * Run the database seeds. * * @return void */ public function run() { $states = array("Alabama", "Alaska", "Arizona", "Arkansas", "California", "Colorado", "Connecticut", "Delaware", "Florida", "Georgia", "Hawaii", "Idaho", "Illinois", "Indiana", "Iowa", "Kansas", "Kentucky", "Louisiana", "Maine", "Maryland", "Massachusetts", "Michigan", "Minnesota", "Mississippi", "Missouri", "Montana", "Nebraska", "Nevada", "New Hampshire", "New Jersey", "New Mexico", "New York", "North Carolina", "North Dakota", "Ohio", "Oklahoma", "Oregon", "Pennsylvania", "Rhode Island", "South Carolina", "South Dakota", "Tennessee", "Texas", "Utah", "Vermont", "Virginia", "Washington", "West Virginia", "Wisconsin", "Wyoming"); foreach ($states as $state) { DB::table('states')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'state' => $state]); } }
public static function getFechaHora() { $mytime = Carbon\Carbon::now(); $f = $mytime->format("d/m/Y"); $h = $mytime->format("H:i"); return Response::json(array('error' => false, 'listado' => array("fecha" => $f, "hora" => $h)), 200); }
/** * Run the database seeds. * * @return void */ public function run() { DB::table('properties')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'address' => '1234 First Ave', 'city' => 'Town', 'state' => 'Povince', 'area' => '600', 'beds' => '1', 'baths' => '1', 'notes' => 'blasgal']); DB::table('properties')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'address' => '200 Main Street', 'city' => 'Town', 'state' => 'Povince', 'area' => '700', 'beds' => '2', 'baths' => '1', 'notes' => 'blasgal']); DB::table('properties')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'address' => '3 Lost Way', 'city' => 'Subtown', 'state' => 'Povince', 'area' => '1400', 'beds' => '3', 'baths' => '1', 'notes' => 'blasgal']); DB::table('properties')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'address' => '2030 Supreme Street', 'city' => 'Metropolis', 'state' => 'North Territory', 'area' => '1000', 'beds' => '1', 'baths' => '1', 'notes' => '']); }
/** * Run the database seeds. * * @return void */ public function run() { // Unit IDs $poundID = Unit::where('name', 'pound')->first()->id; $meterID = Unit::where('name', 'meter')->first()->id; $mileID = Unit::where('name', 'mile')->first()->id; /************* *** SQUAT *** *************/ DB::table('exercise_measurements')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'exercise_group_id' => 1, 'set_order' => 1, 'weight_unit_id' => $poundID, 'weight' => 300, 'distance_unit_id' => $meterID, 'distance' => null, 'time' => null, 'reps' => 5]); DB::table('exercise_measurements')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'exercise_group_id' => 1, 'set_order' => 2, 'weight_unit_id' => $poundID, 'weight' => 300, 'distance_unit_id' => $meterID, 'distance' => null, 'time' => null, 'reps' => 5]); DB::table('exercise_measurements')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'exercise_group_id' => 1, 'set_order' => 3, 'weight_unit_id' => $poundID, 'weight' => 300, 'distance_unit_id' => $meterID, 'distance' => null, 'time' => null, 'reps' => 5]); DB::table('exercise_measurements')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'exercise_group_id' => 1, 'set_order' => 4, 'weight_unit_id' => $poundID, 'weight' => 300, 'distance_unit_id' => $meterID, 'distance' => null, 'time' => null, 'reps' => 5]); DB::table('exercise_measurements')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'exercise_group_id' => 1, 'set_order' => 5, 'weight_unit_id' => $poundID, 'weight' => 300, 'distance_unit_id' => $meterID, 'distance' => null, 'time' => null, 'reps' => 5]); /********************** *** OVERHEAD PRESS *** **********************/ DB::table('exercise_measurements')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'exercise_group_id' => 2, 'set_order' => 1, 'weight_unit_id' => $poundID, 'weight' => 130, 'distance_unit_id' => $meterID, 'distance' => null, 'time' => null, 'reps' => 5]); DB::table('exercise_measurements')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'exercise_group_id' => 2, 'set_order' => 2, 'weight_unit_id' => $poundID, 'weight' => 130, 'distance_unit_id' => $meterID, 'distance' => null, 'time' => null, 'reps' => 5]); DB::table('exercise_measurements')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'exercise_group_id' => 2, 'set_order' => 3, 'weight_unit_id' => $poundID, 'weight' => 130, 'distance_unit_id' => $meterID, 'distance' => null, 'time' => null, 'reps' => 5]); DB::table('exercise_measurements')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'exercise_group_id' => 2, 'set_order' => 4, 'weight_unit_id' => $poundID, 'weight' => 130, 'distance_unit_id' => $meterID, 'distance' => null, 'time' => null, 'reps' => 5]); DB::table('exercise_measurements')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'exercise_group_id' => 2, 'set_order' => 5, 'weight_unit_id' => $poundID, 'weight' => 130, 'distance_unit_id' => $meterID, 'distance' => null, 'time' => null, 'reps' => 5]); /**************** *** DEADLIFT *** ****************/ DB::table('exercise_measurements')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'exercise_group_id' => 3, 'set_order' => 1, 'weight_unit_id' => $poundID, 'weight' => 345, 'distance_unit_id' => $meterID, 'distance' => null, 'time' => null, 'reps' => 5]); /**************** *** PULL-UPS *** ****************/ DB::table('exercise_measurements')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'exercise_group_id' => 4, 'set_order' => 1, 'weight_unit_id' => $poundID, 'weight' => null, 'distance_unit_id' => $meterID, 'distance' => null, 'time' => null, 'reps' => 10]); DB::table('exercise_measurements')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'exercise_group_id' => 4, 'set_order' => 2, 'weight_unit_id' => $poundID, 'weight' => null, 'distance_unit_id' => $meterID, 'distance' => null, 'time' => null, 'reps' => 10]); DB::table('exercise_measurements')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'exercise_group_id' => 4, 'set_order' => 3, 'weight_unit_id' => $poundID, 'weight' => null, 'distance_unit_id' => $meterID, 'distance' => null, 'time' => null, 'reps' => 10]); DB::table('exercise_measurements')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'exercise_group_id' => 5, 'set_order' => 1, 'weight_unit_id' => $poundID, 'weight' => null, 'distance_unit_id' => $mileID, 'distance' => 1.5, 'time' => 600, 'reps' => null]); DB::table('exercise_measurements')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'exercise_group_id' => 5, 'set_order' => 2, 'weight_unit_id' => $poundID, 'weight' => null, 'distance_unit_id' => $mileID, 'distance' => 1.5, 'time' => 600, 'reps' => null]); }
/** * Run the database seeds. * * @return void */ public function run() { DB::table('kids')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'name' => 'John', 'gender' => 'M', 'family_code' => 'helloworld']); DB::table('kids')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'name' => 'Jasper', 'gender' => 'M', 'avatar' => '111111.JPG', 'family_code' => 'hellojasper']); DB::table('kids')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'name' => 'Olivia', 'gender' => 'F', 'family_code' => 'hellooly']); DB::table('kids')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'name' => 'Emily', 'gender' => 'F', 'family_code' => 'helloemily']); }
public function testSubscribedHandlesNoCardUpFront() { $billable = new BillableTraitTestStub(); $billable->trial_ends_at = null; $billable->conekta_active = null; $billable->subscription_ends_at = null; $this->assertFalse($billable->subscribed()); $billable = new BillableTraitTestStub(); $billable->conekta_active = 0; $billable->trial_ends_at = Carbon\Carbon::now()->addDays(5); $this->assertTrue($billable->subscribed()); $billable = new BillableTraitTestStub(); $billable->conekta_active = true; $billable->trial_ends_at = Carbon\Carbon::now()->subDays(5); $this->assertTrue($billable->subscribed()); $billable = new BillableTraitTestStub(); $billable->conekta_active = false; $billable->trial_ends_at = Carbon\Carbon::now()->subDays(5); $billable->subscription_ends_at = null; $this->assertFalse($billable->subscribed()); $billable = new BillableTraitTestStub(); $billable->trial_ends_at = null; $billable->conekta_active = null; $billable->subscription_ends_at = Carbon\Carbon::now()->addDays(5); $this->assertTrue($billable->subscribed()); $billable = new BillableTraitTestStub(); $billable->trial_ends_at = null; $billable->conekta_active = null; $billable->subscription_ends_at = Carbon\Carbon::now()->subDays(5); $this->assertFalse($billable->subscribed()); }
/** * Run the database seeds. * * @return void */ public function run() { // for ($i = 0; $i < 10; $i++) { DB::table('my_flights')->insert(['name' => str_random(6), 'airline' => str_random(10), 'created_at' => Carbon\Carbon::now(), 'updated_at' => \Carbon\Carbon::now()]); } }