Subscribe to PHP Freaks RSS

Pine: Binding Relevant Models to Routes in Nested Laravel Resources

syndicated from www.phpdeveloper.org on June 3, 2019

Route model binding is a great and well-known feature of the Laravel framework. But, when we work with nested resources, we might write a custom rule explicitly that ensures the child models can be load with the correct parent model. Let’s see!

A Concrete Example Let’s say we have a ...