Tech
Laravel Route Model Binding: Implicit, Explicit & Scoped
Laravel route model binding is the reason a resource controller rarely contains a manual Post::findOrFail($id) call. Part 1 covered how Laravel routing works at a basic level, and ended on the {post} parameter in a resource route resolving straight to a Post model instead of a raw ID. This part covers how that actually happens, and the handful of places it stops working the way you'd expect: custom lookup columns, nested resources, and soft-deleted rows.
Implicit binding: mat...
Read the full discussion on Dev.to
This article was aggregated from Dev.to. Click to join the conversation.
View on Dev.to