public function destroy(Permission $permission)
    {
        if (! $permission->system) {
            try {
                $permission->delete();

                return $this->notifySuccess('Permission successfully deleted!');
            } catch (QueryException $e) {
                return $this->notifyError($e->getMessage());
            }
        }

        return $this->notifyError('System permission is protected and cannot be deleted!');
    }
public function destroy(Permission $permission)
    {
        if (! $permission->system) {
            try {
                $permission->delete();

                return $this->notifySuccess('Permission successfully deleted!');
            } catch (QueryException $e) {
                return $this->notifyError($e->getMessage());
            }
        }

        return $this->notifyError('System permission is protected and cannot be deleted!');
    }
public function destroy ( Permission $ permission ) { if ( ! $ permission -> system ) { try { $ permission -> delete ( ) ; return $ this -> notifySuccess ( 'Permission successfully deleted!' ) ; } catch ( QueryException $ e ) { return $ this -> notifyError ( $ e -> getMessage ( ) ) ; } } return $ this -> notifyError ( 'System permission is protected and cannot be deleted!' ) ; }
Remove selected permission.

@param \Yajra\Acl\Models\Permission $permission
@return \Illuminate\Http\RedirectResponse
Remove selected permission .