php - Explicit Model Binding results in Not Found

Does anyone know why Route::model in RouteServiceProvider results in Not Found for spa routes?
public function boot()
{
Route::model('status', Status::class);
$this->configureRateLimiting();
$this->routes(function() {
Route::prefix('api')
->middleware('api')
->namespace($this->namespace)
->group(base_path('routes/api.php'));
Route::middleware('web')
->namespace($this->namespace)
->group(base_path('routes/web.php'));
});
}
web.phpRoute::view('/{any}', 'app')->where('any', '.*')
If you changeRoute::model('statuses', Status::class)
it works. Otherwise it results in the query being fired.
select * from statuses where id = 200 limit 1
It feels like it takes conflicts with name 'status' does anyone know what could be causing it?
public function view($uri, $view, $data = [], $status = 200, array $headers = [])
{
return $this->match(['GET', 'HEAD'], $uri, '\Illuminate\Routing\ViewController')
->setDefaults([
'view' => $view,
'data' => $data,
'status' => is_array($status) ? 200 : $status,
'headers' => is_array($status) ? $status : $headers,
]);
}
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: property [id] does not exist on this collection instance.
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.