REBELinBLUE\Deployer\Repositories\EloquentRepository::deleteById PHP Method

deleteById() public method

Delete an instance by it's ID.
public deleteById ( integer $model_id ) : boolean
$model_id integer
return boolean
    public function deleteById($model_id)
    {
        $model = $this->getById($model_id);
        return $model->delete();
    }

Usage Example

 /**
  * Remove the specified model from storage.
  *
  * @param int $model_id
  *
  * @return array
  */
 public function destroy($model_id)
 {
     $this->repository->deleteById($model_id);
     return ['success' => true];
 }