Laravel Pro Tips
#routes #models
Laravel tip π‘You can use the 'resolveRouteBinding' method on your model to modify the value that is used to resolve the binding.
Philo Hermans
#routes #redirects
π#Laravel Tip |Β Need to redirect? Laravel has multiple ways of doing that. And the best part is, they all work. #laraveltip #php #tip
Bert De Swaef
#routes
π₯ #Laravel Tip: Make use of signed and temporary signed routes to prevent people modifying important urls / links.
Matt Kingshott
#Laravel Tip π₯ When using a custom keyed implicit binding as a nested route parameter, Laravel will automatically scope the query to retrieve the nested model by its parent using conventions to guess the relationship name on the parent.
Sanjit Singh
#routes #views
π₯ Laravel Tip: Make sure to use Route::view() when it's possible. Check out this example:
Francisco Madeira
#routes #controllers #resource
Laravel tip π₯ Instead of writing multiple resource controllers, you can register many resource controllers at once by passing an array to the resources method. #laravel #buildinpublic #coding
Hamza Ikram || Laravel Developer
π₯ Laravel Tip: Customizing The Resolution Logic You can define how your model gets bound by overwriting the resolveRouteBinding in your model class. For example, if you need to resolve a model with two separated fields.
Cosme Escobedo
#routes #controllers
#Laravel Tip β‘ Instead of using the controller in each route, consider using a route controller group.
#routes #models #404
π₯ 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.
Jan 12th, 2023
#routes #controllers #middleware
Laravel Middleware: Put in Routes, Controller, or Elsewhere? (4 Options)
If you have a Middleware, where you should use it: in the Routes file or in the Controller? Here are the FOUR options.