This might be widely known, but I had no idea that since Laravel 5.5 there's auth and guard Blade directives. I've been using if(Auth::check()) this whole time!
Just discovered Laravel's "@.production" blade directive. So useful for all sorts of analytics-y things inside <head> 👌
🔥 Tip: You can use this helper to convert Blade code to HTML. Very useful when testing custom Blade directives.
You can also skip command prompts when seeding the database by using -n flag #Laravel
Do you have multiple #Laravel factory states and you want to seed the database with each state? Take this example where it will ask you how many entries for each state you want to create
A nice tip when writing tests is to create incomplete tests for the parts that you still need to write tests for. This helps me keep track of the features that I still need to cover with tests.
A lot of times I use @Alpine_JS for simple UI niceties, like fading an element out after a given time, toggling a class on click, etc. Writing all of this x-... code every single time is quite cumbersome, so I created a couple of Blade directives that make this super easy.
If you are using @spatie_be package-skeleton-laravel or your #PHPUnit generates reports in a build folder, mark your build folder as excluded so that #phpstorm doesn't index your project every time you run a test. https://t.co/BjuVxvOAC6 #Laravel
💎 @LaravelLivewire gem The "$refresh" magic action is especially powerful when you want to refresh one component from another one! Here, I'm updating the DomainForm component, whenever I switch the user team within the TeamSwitcher component.
Starting Laravel v8.44.0, you may customize how to handle lazy loading violations. (e.g. log the incident but don't throw an exception) Find more in this video: https://t.co/ocosSjYjP9
In Laravel, your model can implement the *HasLocalePreference* contract. That way, Laravel will set the locale for any mailable sent to that model instance based on your instructions. More details: https://t.co/uIKMqCJFJE
A new "Conditionable" trait is available in Laravel. Some Laravel classes such as the query builder already offered "when" and "unless" methods for conditionally executing a callback chain. Now you can easily add this feature to your own classes! 🔥