filmov
tv
Exploring Laravel's Route Model Binding

Показать описание
Here I go over Laravel's route model binding. This is a way to have the framework automatically return a model from your database, based off a variable in your URL.
I get into how to set things up, customizing keys, and using the new 'Scoped Route Models' that were added in Laravel 7.x. This is a very handy feature for when you have multiple variables in a URL. So:
/companies/{company}/users/{user}
With scoped route models, you can make sure that the 'user' model belongs to the 'company' model from the URL. Nice!
If this was helpful, I'd love your support by Liking or Subscribing. But I'm sure you already knew that ;)
I get into how to set things up, customizing keys, and using the new 'Scoped Route Models' that were added in Laravel 7.x. This is a very handy feature for when you have multiple variables in a URL. So:
/companies/{company}/users/{user}
With scoped route models, you can make sure that the 'user' model belongs to the 'company' model from the URL. Nice!
If this was helpful, I'd love your support by Liking or Subscribing. But I'm sure you already knew that ;)