delete() public method

Delete a permission from storage
Author: Steve Montambeault
public delete ( $id ) : boolean
$id
return boolean
Exemplo n.º 1
0
 /**
  * Delete a permission module
  *
  * @author Steve Montambeault
  * @link   http://stevemo.ca
  *
  * @param $id
  *
  * @return \Illuminate\Http\RedirectResponse
  */
 public function destroy($id)
 {
     if ($this->permissions->delete($id)) {
         return Redirect::route('cpanel.permissions.index')->with('success', Lang::get('cpanel::permissions.delete_success'));
     } else {
         return Redirect::route('cpanel.permissions.index')->with('error', Lang::get('cpanel::permissions.model_not_found'));
     }
 }