コード例 #1
0
 public function edit($id)
 {
     if (Auth::user()->can('update-clients')) {
         $client = Client::findOrFail($id);
         $seccionales = Seccional::orderBy('name', 'asc')->lists('name', 'id');
         return view('client::edit', compact('client', 'seccionales'));
     }
     return redirect('auth/logout');
 }
コード例 #2
0
 public function destroy($id)
 {
     if (Auth::user()->can('delete-seccionales')) {
         $seccional = Seccional::findOrFail($id);
         Seccional::destroy($id);
         Session::flash('message', trans('client::ui.seccional.message_delete', array('name' => $seccional->name)));
         return redirect('client/seccional');
     }
     return redirect('auth/logout');
 }