In this section you can read posts I've written myself.

Asserting valid and invalid requests in Laravel

Original – by Brent Roose – 1 minute read

Testing a Laravel project is one of the most pleasant experiences I've ever had: there's a clean testing API, a very powerful layer added on top of testing frameworks; all while keeping the simplicity and eloquence you'd expect from a Laravel project.

Read more

Stay up to date with all things Laravel, PHP, and JavaScript.

Follow me on Twitter. I regularly tweet out programming tips, and what I myself have learned in ongoing projects.

Every two weeks I send out a newsletter containing lots of interesting stuff for the modern PHP developer.

Expect quick tips & tricks, interesting tutorials, opinions and packages. Because I work with Laravel every day there is an emphasis on that framework.

Rest assured that I will only use your email address to send you the newsletter and will not use it for any other purposes.

How to convert a PHPUnit Testsuite to Pest

Original – by Freek Van der Herten – 2 minute read

While recording videos for the Testing Laravel video course, I became a big fan of Pest, a test runner that tries to optimize the developer experience. I'm now using Pest as the default for testing new packages and projects.

I've also converted a couple of existing testsuites from PHPUnit to Pest. Luckily, this is a very easy process. In this video I'll show you how to get started. You'll see that it only takes a couple of minutes.

Read more

Building a simple dashboard using Tailwind

Original – by Freek Van der Herten – 1 minute read

In this stream, Shruti Balasa show how powerful Tailwind is. She builds a simple dashboard layout in only a couple of minutes.If you want to learn more about Tailwind, consider buying a ticket for her online workshop at Full Stack Europe.You can get a 20% discount for Shruti's workshop by using this…

Read more

Strategies for decreasing the number of queries in a Laravel app

Original – by Freek Van der Herten – 13 minute read

Oh Dear is all-in-one solution to monitor your site that my buddy Mattias Geniar and I have created. It can monitoring uptime, certificates, broken links, scheduled jobs, and much more.

Under the hood, Oh Dear is a large Laravel application that performs many queries all of the time. To power future features, we've recently changed our database structure and refactored some pieces in our code base. We increased performance by decreasing the number of queries.

In this blog post, we'd like to to share some techniques that might be helpfull to increase the performance of your Laravel app too.

Read more

How to handle GitHub webhooks in a Laravel application

Original – by Freek Van der Herten – 3 minute read

Whenever something happens in one of your repos on GitHub, you can configure a webhook to be sent to your app. This way, you can perform some extra logic when a particular event occurs on the repo. A silly example would be to send someone a mail when an issue is opened.

We've created a new package called spatie/laravel-github-webhooks that makes it easy to consume GitHub webhooks in a Laravel app. In this blog post, I'd like to tell you all about it.

Read more

How to render markdown with perfectly highlighted code snippets

Original – by Freek Van der Herten – 6 minute read

When reading technical blogpost around the web, you might have noticed that code highlighting is not always perfect.

Shiki is the code highlighter that uses the textmate parser VSCode uses under the hood. The code highlighting it provides is near perfect, even when using modern syntax. It supports 100+ languages (via our package Blade is supported too), and all VS Code themes.

I'm proud to announce that we have released three new Spatie packages that make it easy to use Shiki in your PHP projects:

  • shiki-php: makes it easy to call Shiki from PHP to highlight a given code snippet
  • commonmark-shiki-highlighter: allows commonmark to highlight all code snippets in a markdown fragment
  • laravel-markdown: a batteries included Laravel package that offers a Blade component to easily render Markdown with highlighted code snippets and a class to render Markdown manually.

We're already using this package to render all our documentation pages, our guidelines, and this very blog you are reading.

Read more

🚀 Event Sourcing for Laravel is now available

Original – by Freek Van der Herten – 1 minute read

I'm thrilled to announce that our premium course Event Sourcing in Laravel has just launched.

If you ever wanted to get started with event sourcing, this is the course for you. It contains a beautifully designed ebook, two hours worth of videos, and a demo Laravel app containing an event-sourced shopping cart.

Event sourcing isn't an all or nothing approach. Even if your project doesn't need the full power of event sourcing, you can still benefit from knowing and implementing best practices from the event sourcing world.

We're offering a 20% launch discount for the next two weeks to celebrate this release.

In this stream, you can see my colleague Brent and I launch the course, and answer questions from the audience.

Read more

A new design for Ignition

Original – by Freek Van der Herten – 5 minute read

A couple of years ago, Ignition became the default error page in Laravel.

Ignition provided a vastly improved design over Whoops: it brought Laravel specific niceties (such as showing the routing, queries) and the ability to display and even run solutions (e.g. generating an app key).

At Spatie, we think we can improve the design of Ignition even more. Our initial plan was to release this new design in tandem with Laravel 9 as a big bang surprise release. We've changed our mind on this because we'd like to have feedback from the community.

In this blog post, I'd like to share our ideas and plans for Ignition.

Read more