Exemplo n.º 1
0
 /**
  * Update the specified Permission in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function update(Request $request, $id)
 {
     $permesso = Permission::findOrFail($id);
     $name = rtrim($request->input('name'));
     if (strlen($name) > 1) {
         $permesso->update(['name' => $name]);
     }
     return redirect()->to('/admin/utenti/permessi');
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param int $id
  *
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     $permission = Permission::findOrFail($id);
     $permission->delete();
     return redirect('permissions');
 }