With the release of Laravel  v8.26.0, the Router has a new missing() method for a convenient way to handle missing records when using route model binding.

_A new Route::()…->missing() method ships in today’s Laravel release. Contributed by @hotmeteor … check out the docs here! _https://t.co/gdhOAeJ3nS

_— Taylor Otwell (@taylorotwell) _February 2, 2021

By default, route model binding will return a 404 if someone tries to access an non-existent record. Currently, you’d need some customization to check and handle it accordingly.

#news #releases #laravel

New Laravel Route “Missing” Method
1.40 GEEK