Illuminate\Database\Eloquent\Model::forceDelete PHP Method

forceDelete() public method

This method protects developers from running forceDelete when trait is missing.
public forceDelete ( ) : boolean | null
return boolean | null
    public function forceDelete()
    {
        return $this->delete();
    }

Usage Example

 /**
  * @param Model $model
  * @return bool|null
  */
 public function forceDelete(Model $model)
 {
     $deleted = $model->forceDelete();
     if ($deleted) {
         app('cache')->flush();
     }
     return $deleted;
 }
Model