Ejemplo n.º 1
0
 public function destroy($id)
 {
     if (Auth::user()->can('delete-conditions')) {
         $condition = Condition::findOrFail($id);
         Condition::destroy($id);
         Session::flash('message', trans('car::ui.condition.message_delete', array('name' => $condition->name)));
         return redirect('car/condition');
     }
     return redirect('auth/logout');
 }
Ejemplo n.º 2
0
 public function edit($id)
 {
     if (Auth::user()->can('update-cars')) {
         $car = Car::findOrFail($id);
         $brands = Brand::orderBy('name', 'asc')->lists('name', 'id');
         $prototypes = Prototype::orderBy('name', 'asc')->lists('name', 'id');
         $colors = Color::orderBy('name', 'asc')->lists('name', 'id');
         $conditions = Condition::orderBy('name', 'asc')->lists('name', 'id');
         return view('car::edit', compact('car', 'brands', 'prototypes', 'colors', 'conditions'));
     }
     return redirect('auth/logout');
 }