/** * 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); }
/** * Run the database seeds. * * @return void */ public function run() { DB::table('proyectos')->insert(['user_id' => '1', 'last_update_user_id' => '1', 'created_at' => Carbon\Carbon::now(), 'updated_at' => Carbon\Carbon::now(), 'client_id' => '1', 'name' => 'Software para la gestión código javascript', 'starting_date' => Carbon\Carbon::now(), 'ending_date' => Carbon\Carbon::now(), 'notes' => 'Desarrollo de una página web básica.']); DB::table('proyectos')->insert(['user_id' => '1', 'last_update_user_id' => '1', 'created_at' => Carbon\Carbon::now(), 'updated_at' => Carbon\Carbon::now(), 'client_id' => '2', 'name' => 'Proyecto secreto', 'starting_date' => Carbon\Carbon::now(), 'ending_date' => Carbon\Carbon::now(), 'notes' => 'Software para lograr la dominación mundial.']); DB::table('proyectos')->insert(['user_id' => '3', 'last_update_user_id' => '1', 'created_at' => Carbon\Carbon::now(), 'updated_at' => Carbon\Carbon::now(), 'client_id' => '3', 'name' => 'PYME App', 'starting_date' => Carbon\Carbon::now(), 'ending_date' => Carbon\Carbon::now(), 'notes' => 'Aplicación web para gestión de PYME.']); DB::table('proyectos')->insert(['user_id' => '1', 'last_update_user_id' => '1', 'created_at' => Carbon\Carbon::now(), 'updated_at' => Carbon\Carbon::now(), 'client_id' => '4', 'name' => 'Plugin para JavaScript', 'starting_date' => Carbon\Carbon::now(), 'ending_date' => Carbon\Carbon::now(), 'notes' => 'Plugin para agilizar el desarrollo de scripts.']); }
/** * 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('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('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() { 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' => '*****@*****.**']); }
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'); } } }
/** * 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()]); } }
/** * Run the database seeds. * * @return void */ public function run() { DB::table('clientes')->insert(['user_id' => '1', 'last_update_user_id' => '1', 'name' => 'Valentín', 'surname' => 'Pedrosa', 'nif' => '12345678M', 'country' => 'España', 'city' => 'Granada', 'zip_code' => '18012', 'address_1' => 'Calle aleatoria Nº1', 'phone' => '123456789', 'mobile' => '123456789', 'email' => '*****@*****.**', 'created_at' => Carbon\Carbon::now(), 'updated_at' => Carbon\Carbon::now()]); DB::table('clientes')->insert(['user_id' => '1', 'last_update_user_id' => '1', 'name' => 'Ramón', 'surname' => 'Sanchez', 'nif' => '12345679M', 'country' => 'España', 'city' => 'Granada', 'zip_code' => '18012', 'address_1' => 'Calle aleatoria Nº1', 'phone' => '123456789', 'mobile' => '123456789', 'email' => '*****@*****.**', 'created_at' => Carbon\Carbon::now(), 'updated_at' => Carbon\Carbon::now()]); DB::table('clientes')->insert(['user_id' => '1', 'last_update_user_id' => '1', 'name' => 'Jose', 'surname' => 'Conejero', 'nif' => '12345677M', 'country' => 'España', 'city' => 'Granada', 'zip_code' => '11300', 'address_1' => 'Calle aleatoria Nº1', 'phone' => '123456789', 'mobile' => '123456789', 'email' => '*****@*****.**', 'created_at' => Carbon\Carbon::now(), 'updated_at' => Carbon\Carbon::now()]); DB::table('clientes')->insert(['user_id' => '1', 'last_update_user_id' => '1', 'name' => 'Pablo', 'surname' => 'Lara', 'nif' => '12345668M', 'country' => 'España', 'city' => 'La Linea', 'zip_code' => '11300', 'address_1' => 'Calle aleatoria Nº1', 'phone' => '123456789', 'mobile' => '123456789', 'email' => '*****@*****.**', 'created_at' => Carbon\Carbon::now(), 'updated_at' => Carbon\Carbon::now()]); }
/** * Run the database seeds. * * @return void */ public function run() { DB::table('servicios')->insert(['user_id' => '1', 'last_update_user_id' => '1', 'created_at' => Carbon\Carbon::now(), 'updated_at' => Carbon\Carbon::now(), 'name' => 'Mantenimiento basica', 'description' => 'Mantenimiento de una página web básica', 'price' => '49', 'development_time' => 'Dos semanas', 'invoice_period' => '6', 'status' => 'Activo']); DB::table('servicios')->insert(['user_id' => '1', 'last_update_user_id' => '1', 'created_at' => Carbon\Carbon::now(), 'updated_at' => Carbon\Carbon::now(), 'name' => 'Mantenimiento basic & shop', 'description' => 'Mantenimiento de una página web básica con tienda', 'price' => '99', 'development_time' => '3 semanas', 'invoice_period' => '9', 'status' => 'Activo']); DB::table('servicios')->insert(['user_id' => '1', 'last_update_user_id' => '1', 'created_at' => Carbon\Carbon::now(), 'updated_at' => Carbon\Carbon::now(), 'name' => 'Mantenimiento original', 'description' => 'Mantenimiento de una página web con diseño original', 'price' => '149', 'development_time' => '1 mes y medio', 'invoice_period' => '12', 'status' => 'Activo']); DB::table('servicios')->insert(['user_id' => '1', 'last_update_user_id' => '1', 'created_at' => Carbon\Carbon::now(), 'updated_at' => Carbon\Carbon::now(), 'name' => 'Mantenimiento original & shop', 'description' => 'Mantenimiento página web con diseño original y tienda', 'price' => '199', 'development_time' => '2 meses', 'invoice_period' => '16', 'status' => 'Activo']); }
/** * Run the database seeds. * * @return void */ public function run() { $faker = Faker\Factory::create(); foreach (range(1, 100) as $index) { DB::table('books')->insert(['title' => $faker->word(), 'preview' => $faker->sentence(), 'author_id' => \App\Models\Author::orderByRaw("RAND()")->first()->id, 'created_at' => Carbon\Carbon::now(), 'updated_at' => Carbon\Carbon::now()]); } }
/** * Run the database seeds. * * @return void */ public function run() { DB::table('approvals')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'comments' => 'First version approved', 'approver_id' => 1]); DB::table('approvals')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'comments' => 'Second version approved', 'approver_id' => 2]); DB::table('approvals')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'comments' => 'Third version approved', 'approver_id' => 3]); // }
/** * Run the database seeds. * * @return void */ public function run() { // DB::table('games')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString()]); DB::table('games')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString()]); DB::table('games')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString()]); }
/** * Run the database seeds. * * @return void */ public function run() { // DB::table('code_entries')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'last_sha' => 'A1B1C1D1E1F1', 'comments' => 'First version', 'branch_name' => 'code_init', 'developer' => 1, 'test_run_id' => 1, 'approval_id' => 1]); DB::table('code_entries')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'last_sha' => 'A1B1C1D1E1F2', 'comments' => 'Second version', 'branch_name' => 'feature_one', 'developer' => 2, 'test_run_id' => 2, 'approval_id' => 2]); DB::table('code_entries')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'last_sha' => 'A1B1C1D1E1F3', 'comments' => 'Third version', 'branch_name' => 'feature_two', 'developer' => 3, 'test_run_id' => 3, 'approval_id' => 3]); }
/** * Run the database seeds. * * @return void */ public function run() { // DB::table('test_runs')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'comments' => 'First version Tested', 'tester_id' => 1, 'merged_up_to_master' => 'Yes', 'passed' => 1]); DB::table('test_runs')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'comments' => 'Second version Tested', 'tester_id' => 2, 'merged_up_to_master' => 'Yes', 'passed' => 1]); DB::table('test_runs')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'comments' => 'Third version Tested', 'tester_id' => 3, 'merged_up_to_master' => 'Yes', 'passed' => 1]); }
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('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']); }
/** * 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']); }
/** * 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]); } }
/** * 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()]); } }
/** * 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() { // 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('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() { 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() { 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('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() { // 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('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']); }
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() { //User 1 //Necessary user columns $user = \App\User::firstOrCreate(['email' => '*****@*****.**']); $user->name = 'Jill'; $user->email = '*****@*****.**'; $user->password = \Hash::make('helloworld'); //User profile columns $user->birthday = Carbon\Carbon::now()->subYears(21); $user->gender = 'Woman'; $user->pronouns = "she/her"; $user->save(); //User 2 - used to demonstrate inability to access posts by a user you are not sign in as //Necessary user columns $user = \App\User::firstOrCreate(['email' => '*****@*****.**']); $user->name = 'Jamal'; $user->email = '*****@*****.**'; $user->password = \Hash::make('helloworld'); //User profile columns $user->birthday = Carbon\Carbon::now()->subDays(20)->subYears(28); $user->gender = 'Man'; $user->pronouns = "he/him"; $user->save(); //User 3 - used to demonstrate how a lack of posts or profile information is handled //Necessary user columns $user = \App\User::firstOrCreate(['email' => '*****@*****.**']); $user->name = 'Jan'; $user->email = '*****@*****.**'; $user->password = \Hash::make('helloworld'); $user->save(); }