Пример #1
0
 /**
  * {@inheritDoc}
  */
 public function create(array $data, $validate = true)
 {
     $this->rules = ['name' => 'required', 'slug' => 'required|unique:permissions'];
     if ($validate) {
         $this->validate($data);
     }
     try {
         $permission = $this->permission->create($data);
     } catch (QueryException $e) {
         throw new PermissionsException(trans('dashboard::dashboard.errors.permission.create'));
     }
     return $permission;
 }
Пример #2
0
 /**
  * {@inheritDoc}
  */
 public function find($id)
 {
     return Permission::find($id);
 }