php artisan route:cache
doesn't work with route model bindings
$this->bind('project', function ($project)
{
try
{
return Project::whereKey($project)->firstOrFail();
}
catch(ModelNotFoundException $e)
{
throw new NotFoundHttpException;
}
});
How can i cache this binding?
UPD. I replace a anonimous function to string RouteBindings@project
, but bindings still not caching with php artisan route:cache
UPD2 Problem solved with placing bindings to RouteServiceProvider::boot
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community