Ejemplo n.º 1
0
 public function destroy($id)
 {
     if (Auth::user()->can('delete-brands')) {
         $brand = Brand::findOrFail($id);
         Brand::destroy($id);
         Session::flash('message', trans('car::ui.brand.message_delete', array('name' => $brand->name)));
         return redirect('car/brand');
     }
     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');
 }