예제 #1
0
 /**
  * Create a new model instance.
  *
  * @param array $attributes
  */
 public function __construct(array $attributes = [])
 {
     parent::__construct($attributes);
     if ($connection = config('roles.connection')) {
         $this->connection = $connection;
     }
 }
예제 #2
0
 /**
  * @param $id
  * @return bool|null
  * @throws \Exception
  */
 protected function destroy($id)
 {
     $this->modelInstance = $this->modelInstance->withTrashed()->findOrFail($id);
     if ($this->modelInstance->trashed()) {
         return $this->modelInstance->forceDelete();
     }
     return $this->modelInstance->delete();
 }