protected function deleteModel(
        Model $model,
        Resource $resource,
        string $route = null
    ) {
        if ($model->delete()) {
            return;
        }

        $message = "Resource '" . ($route ?? $resource->route)
            . "' could not be deleted";

        $this->sendError(static::ERROR_INTERNAL_SERVER, $message);
    }
protected function deleteModel(
        Model $model,
        Resource $resource,
        string $route = null
    ) {
        if ($model->delete()) {
            return;
        }

        $message = "Resource '" . ($route ?? $resource->route)
            . "' could not be deleted";

        $this->sendError(static::ERROR_INTERNAL_SERVER, $message);
    }
protected function deleteModel ( Model $ model , Resource $ resource , string $ route = null ) { if ( $ model -> delete ( ) ) { return ; } $ message = "Resource '" . ( $ route ?? $ resource -> route ) . "' could not be deleted" ; $ this -> sendError ( static :: ERROR_INTERNAL_SERVER , $ message ) ; }
Deletes a Model

@param Model    $model    Model to be deleted
@param Resource $resource Resource that loaded $model
@param string   $route    Alternative route to $model

@throws RouterException If could not delete the Model
Deletes a Model