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