Open-sourcing our guidelines

At Spatie we recently launched a new site: guidelines.spatie.be. It contains articles on how we go about setting things up at Spatie and a collection of styleguides. The source code of the site is available on GitHub. In this blogpost I’d like to share why and how we created our guidelines site. Why did we […]

Continue reading →

Use your Laravel named routes in JavaScript

Daniel Coulbourne, an engineer at Tighten Co and co-host of the amazing Twenty Percent Time podcast, recently released Ziggy, a tool to share your Laravel named routes with JavaScript. Ziggy creates a Blade directive which you can include in your views. This will export a JavaScript object of your application’s named routes, keyed by their […]

Continue reading →

Videos of PHP Srbija 2017 have been released

The organisers of PHP Serbia have recently released all videos of the 2017 edition of their conference. Watch them all here: https://www.youtube.com/playlist?list=PLfGr5rAHwhIJtdueIX5-9aEE7K94TNTqC 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 about modern […]

Continue reading →

Calculating distance using MySQL

Logan Henson, a developer at Tighten, wrote a new post on the company blog about MySQL’s cool ST_Distance_Sphere function. On a client project recently, we had to make it easy to filter database query results based on the distance between a user and an entity in our database. It’s easy to get overwhelmed in that […]

Continue reading →

Cruddy by design

At this year’s Laracon US Adam Wathan gave a talk titled “Cruddy By Design” on how to structure your controllers better. After the conference he published a new GitHub repo that contains the demo app he refactored on stage. The 4 main tips to improve your code come as PRs on the repo with a […]

Continue reading →

How to write JavaScript-style test watchers in PHP

Christoper Pitt published another excellent piece over at Sitepoint. This time he describes how he built a watcher to automatically recompile his preprocessed code and rerun the tests. In order to reduce the burden of invoking the transformation scripts, boilerplate projects have started to include scripts to automatically watch for file changes; and thereafter invoke […]

Continue reading →

Diving into Laravel Horizon

Laravel Horizon is a kickass dashboard for viewing queued jobs. Co-creator Mohammed Said published two posts about the inner working of the tool. The first one on the Diving Laravel site highlights the overall configuration and how the master supervisor works. Laravel Horizon is a queue manager that gives you full control over your queues, […]

Continue reading →

Optimize images in Laravel apps

A while ago we released image-optimizer. In short this package can make all kinds of images smaller by stripping out metadata and applying a little bit of compression. Read this blogpost to learn more about it. Although it’s pretty easy to work with the package, we felt that we could deliver a more seamless experience […]

Continue reading →

Combining query scopes with explicit model names

🔥Combining query scopes with explicit model names will help keep code cleaner and easier to understand #laravel pic.twitter.com/ixzDdrZcRT — Chris Gmyr (@cmgmyr) July 12, 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 […]

Continue reading →

Determining the owner of a model

I love this little “owns” trait/method that @michaeldyrynda & I came up with for Confomo. Look at that expressiveness. :kisses fingers: pic.twitter.com/dE731Ko1Zw — Matt Stauffer (@stauffermatt) July 7, 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 […]

Continue reading →

Typehint all the things

David Négrier, CTO of the CodingMachine, wrote a nice article on why he likes and how his team uses typehints. As a developer consuming this function, I know how to use it. And if I’m using it wrong, I’ll know right away because PHP will crash with a nice error message when the function is […]

Continue reading →

Testing uploads in Laravel

Testing @spatie_be 's media library with the new #laravel upload fakes 👍 Trust, but verify 😅 #testing pic.twitter.com/Ss98rGloRf — Christoph Rumpel (@christophrumpel) July 3, 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 […]

Continue reading →