Laravel Pro Tips
#blade #directives
As of Laravel 9, we can use the new "pushOnce" directive in our Blade views π #laravel #php
Ash Allen π
#routes #controllers #route groups
π₯ #Laravel Tip: If youβve got a controller with a lot of methods in it, consider using route controller groups (new in V9) to save yourself some unnecessary typing.
Matt Kingshott
#joins #sql
A nice SQL trick - you can update a table from another table using joins π Just added a `deleted_at` column to a table and want it populated by one of it's relations, just do an update statement and join them. One simple, yet powerful query π€―
Oliver Nybroe
#blade #components
In Laravel 9, we can use a cool, shorter syntax for named slots in our Blade components. I love this! π #laravel #php
#eloquent #performance
Boost memory and performance by leveraging Eloquent scopes. Skip model hydration by calling getQuery() then retrieve your results. A tip from @victorsfleite.
Kirschbaum Development
#performance #tracking
Performance Tip π‘ Tracking something like page views with MySQL can be quite a performance hit when dealing with high traffic. Redis is much better at this. You can use Redis and a scheduled command to keep MySQL in sync on a fixed interval.
Philo Hermans
#routes #controllers
Laravel tip: if your routes have a lot of resource controllers, you can group them and call one Route::resources() instead of many single Route::resource() statements.
Povilas Korop | Laravel Courses Creator & Youtuber
#routes #responses #redirects
π₯ #Laravel Tip: Version 9 introduces the βto_routeβ global helper method to simplify returning a redirect to a route. Will you make use of it, or do you prefer the previous way:
#strings
π₯ #Laravel Tip: Version 9 introduces the βstrβ global helper method, which makes it easier to work with the fluent Stringable class by removing the need to import it every time.