route()->action['as'] == 'api.file.store') { if(is_null($request->file('file'))){ app()->bind('file', function () use ($request) { return File::find($request->file); }); } } return $next($request); } }