1
0
Fork 0
mirror of https://github.com/archtechx/laravel-tips.git synced 2025-12-12 13:24:03 +00:00
laravel-tips/content/tips/you-can-use-the-missing-method-to-customize-404-handling-on-a-route.md
Samuel Štancl a2adc750ad Week 14
2022-04-09 02:35:20 +02:00

13 lines
No EOL
584 B
Markdown

---
title: 'You can use the `missing` method to customize 404 handling on a route'
tweet_id: '1512463798287814658'
thread_slug: weekly-thread-2022-14
author_username: cosmeescobedo
images:
- 'https://pbs.twimg.com/media/FPi0WYWUYAQXuWf.jpg'
created_at: 2022-04-08T16:14:04+00:00
slug: you-can-use-the-missing-method-to-customize-404-handling-on-a-route
---
🔥 Laravel tip: Customizing Missing Model Behavior in route model bindings
By default, Laravel throws a 404 error when it can't bind the model, but you can change that behavior by passing a closure to the missing method.