/** * Run the database seeds. * * @return void */ public function run() { DB::table('billboard_owners')->truncate(); $faker = Faker::create(); foreach (range(1, 20) as $index) { BillboardOwner::create(['name' => $faker->company]); } }
/** * Run the database seeds. * * @return void */ public function run() { DB::table('billboards')->truncate(); $faker = Faker::create(); foreach (range(1, 20) as $index) { Billboard::create(['latLng' => $faker->latitude . ", " . $faker->longitude, 'structure' => 'Attached to structure', 'placement' => 'Ground Level', 'size' => '5*15', 'panel_type' => 'Digital', 'road_type' => 'Highway', 'speed_of_road' => 120, 'billboard_owner_id' => BillboardOwner::first()->id]); } }
/** * Show the form for editing the specified Billboard. * * @param int $id * * @return Response */ public function edit($id) { $billboard = $this->billboardRepository->findWithoutFail($id); $billboard_owners = BillboardOwner::lists('name', 'id'); $locations = Location::lists('city', 'id'); if (empty($billboard)) { Flash::error('Billboard not found'); return redirect(route('billboards.index')); } return view('billboards.edit', compact('billboard', 'billboard_owners', 'locations')); }