src/Traits/WorksWithFileUploads.php
private function _checkFileRelationExists(Model $model, $relationName)
    {
        if ((!method_exists($model, $relationName) && !$model->{$relationName}() instanceof Relation)) {
            if (Lang::has('resource-controller.filerelationinexistent')) {
                $message = trans('resource-controller.filerelationinexistent', ['relationName' => $relationName]);
            } else {
                $message = "Request file '{$relationName}' is not named after an existent relation.";
            }
            throw new UploadException($message);
        }
    }
private function _checkFileRelationExists(Model $model, $relationName)
    {
        if ((!method_exists($model, $relationName) && !$model->{$relationName}() instanceof Relation)) {
            if (Lang::has('resource-controller.filerelationinexistent')) {
                $message = trans('resource-controller.filerelationinexistent', ['relationName' => $relationName]);
            } else {
                $message = "Request file '{$relationName}' is not named after an existent relation.";
            }
            throw new UploadException($message);
        }
    }
private function _checkFileRelationExists ( Model $ model , $ relationName ) { if ( ( ! method_exists ( $ model , $ relationName ) && ! $ model -> { $ relationName } ( ) instanceof Relation ) ) { if ( Lang :: has ( 'resource-controller.filerelationinexistent' ) ) { $ message = trans ( 'resource-controller.filerelationinexistent' , [ 'relationName' => $ relationName ] ) ; } else { $ message = "Request file '{$relationName}' is not named after an existent relation." ; } throw new UploadException ( $ message ) ; } }
Throw an exception if request file is not named after an existent relation.

@param Model  $model        The eloquent model.
@param string $relationName The eloquent relation name.

@throws UploadException

@return void
Throw an exception if request file is not named after an existent relation .