Go crazy with Blade directives

🔥 Go crazy with Blade directives. The simplest things can abstract away tons of visual noise from your templates. pic.twitter.com/p5udGWJkhd — David Hemphill (@davidhemphill) June 22, 2017 Freek Van der Herten Freek Van der Herten is a partner and developer at Spatie, an Antwerp based company that specializes in creating web apps with Laravel. After […]

Continue reading →

Comparing model collections

Cool little Laravel 5.5 Eloquent Collection macro to assert two model collections are the same 🤙🏻 pic.twitter.com/zzbkr1fL9T — Adam Wathan (@adamwathan) June 14, 2017 Freek Van der Herten Freek Van der Herten is a partner and developer at Spatie, an Antwerp based company that specializes in creating web apps with Laravel. After hours he writes […]

Continue reading →

Using request()->query()

On Twitter I see a bunch of people regularly tweeting very nice code snippets. Instead of only retweeting those, I’m going to add them to my blog. I’ll tag them with tweet. Here’s the first one: request()->query() is a life saver when dealing with tables that store "sorts" and "filters" in a query string. pic.twitter.com/84P6xvTvSz […]

Continue reading →

Performant Laravel

Chris Fideo, of Servers For Hackers and Shipping Docker, published a new free video serious on optimizing performance for Laravel apps. He shows how to use the built in artisan commands such as config:cache and route:cache,how to optimize queries, build up good indexes and how to add an object cache in a clean way. There […]

Continue reading →

Make your app fly with PHP OPcache

Recently this button to optimize PHP’s OPcache was added to Laravel Forge. If you were wondering what PHP OPcache is all about and what pressing this button does with your application, read this article Olav van Schie wrote on the subject a while ago. Every time you execute a PHP script, the script needs to […]

Continue reading →

Diving Laravel

Mohammed Said, Laravel employee number #1, recently announced that he published a new site where he shares stuff he learned while researching the Laravel code base. The site is called “Diving Laravel”, which is kinda nice knowing that Mohammed is an incredible diver himself. In this website I’m going to share notes on the internals […]

Continue reading →

PHP Generics and why we need them

On the stitcher.io blog a new post appeared that explains the benefits of generics with a practical example. Generics aren’t supported in PHP, but there is an RFC. In today’s blog post we’ll explore some common problems with arrays in PHP. All the problems and issues listed could be solved with a pending RFC which […]

Continue reading →

Quickly dd anything from the commandline

Laravel’s tinker command allows to run any code you want as if you are inside your Laravel app. But if you want to run a single line of code if can be a bit bothersome. You must start up tinker, type the code, press enter, and quit tinker. Our new spatie/laravel-artisan-dd package contains an Artisan […]

Continue reading →

PHP Versions Stats – 2017.1 Edition

Jordi Boggiano, co-creator of Composer / Packages, published some new stats on the usage of PHP versions. Great to see that PHP 7 overall now represents over 50%. A quick note on methodology, because all these stats are imperfect as they just sample some subset of the PHP user base. I look in the packagist.org […]

Continue reading →