route()->action['as'] == 'api.file.store') { app()->bind('collection',function() use ($request) { return Collection::where('name',$request->route('collections_name'))->get(); }); } return $next($request); } }