Here's how you can use PHP's spread operator to merge two arrays together. Technically this will be faster than array_merge too! Spreads also support anything implementing Traversable.
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.
Speaking of alternative syntaxes, this is also perfectly okay in PHP.
You can also use curly braces in PHP switch statements. I honestly don't know why you'd want to do this though... Aside from the argument of readability, I haven't noticed any differences.
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
🔹 Promise.allSettled() The Promise.allSettled() method returns a promise that resolves after all of the given promises have either fulfilled or rejected, with an array of objects that each describes the outcome of each promise.
🔹 Promise.all() The Promise.all() method takes an array of promises as an argument and returns a single Promise that resolves to an array of the results of the input promises.
💎 @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.
Here's how you can skip elements with array destructuring in PHP.