public function fileUpload($modelName, $fieldName)
    {
        $fieldFactory = app('admin_field_factory');

        //get the model and the field object
        $field = $fieldFactory->findField($fieldName);

        return response()->JSON($field->doUpload());
    }
public function fileUpload($modelName, $fieldName)
    {
        $fieldFactory = app('admin_field_factory');

        //get the model and the field object
        $field = $fieldFactory->findField($fieldName);

        return response()->JSON($field->doUpload());
    }
public function fileUpload ( $ modelName , $ fieldName ) { $ fieldFactory = app ( 'admin_field_factory' ) ; //get the model and the field object $ field = $ fieldFactory -> findField ( $ fieldName ) ; return response ( ) -> JSON ( $ field -> doUpload ( ) ) ; }
The POST method that runs when a user uploads a file on a file field.

@param string $modelName
@param string $fieldName

@return JSON
The POST method that runs when a user uploads a file on a file field .