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 →

Bootable Model Traits

On the Tighten co blog Caleb Porzio wrote a small post on how you can boot your model traits. It’s a very handy feature that’s being used a quite a few Spatie packages. TL;DR Use bootNameOfTrait() instead of boot() in a model trait to avoid being overwritten by the base model’s boot() method. https://blog.tighten.co/laravel-tip-bootable-model-traits Freek […]

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 →

Elegant form handling in Laravel

Michael Dyrynda, co-host of both the excellent North Meets South podcast and Laravel News podcast, wrote a short article on how he pragmatically manages forms in a Laravel app. I personally feel that I’m not gaining anything by bringing in another package just to handle generating HTML on my behalf when it’s just as fast […]

Continue reading →

TypeScript With Laravel Mix

In a new post on his blog Sebastian De Deyne, multi disciplinary wizard at Spatie, explains how to set up TypeScript in a typical Laravel app. In a recent Spatie project we decided to give TypeScript a shot for the business critical part of a new application. TypeScript provides static analysis to reduce the chance […]

Continue reading →

Videos of the talks at Laravel Nigeria’s first meetup

On April 22nd Laravel Nigeria held its first meetup. It was a big success with over 150 developers showing up. Here’s a recap written by Neo Ighodaro, the organiser of the meetup: https://blog.devcenter.co/building-the-laravel-nigeria-community-with-over-150-attending-the-first-meetup-c919d5ca373c The talks of the meetup were recorded, you can watch them here: Learn Frontend with Vue.js Deploying Your Laravel Application Surviving With […]

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 →

Expressive Code & Real Time Facades

In a new post on his blog Taylor Otwell gives a nice example on how real time facades can make code more testable. Recently, I worked on some code that surfaced my most common use-case for Laravel 5.4’s “real-time” facades. If you’re not familiar with this feature, it allows you to use any of your […]

Continue reading →

Moving from PHP (Laravel) to Go

Danny Van Kooten did an interesting experiment. He completely rewrote an Laravel app to a version in Go. In a post on his blog he shares some details about his project along with some benchmarks. Earlier this year, I made an arguably bad business decision. I decided to rewrite the Laravel application powering Boxzilla in […]

Continue reading →