/** * Run the database seeds. * * @return void */ public function run() { DB::table('metro')->delete(); for ($i = 0; $i < count($this->items); $i++) { $row = array_combine(['name', 'city_id'], $this->items[$i]); Metro::create($row); } }
/** * Remove the specified resource from storage. * * @param int $id * @return Response * @internal param Request $request */ public function destroy($id) { Metro::destroy($id); Flash::success("Запись - {$id} удалена"); return redirect(route('admin.metro.index')); }
/** * @param $id * @return static * @internal param $city * @internal param $id */ public function city($id) { return Metro::where('city_id', $id)->orderBy('name')->get(); }