Join 9,500+ smart developers

Get my monthly newsletter with what I learn from running Spatie, building Oh Dear, and maintaining 300+ open source packages. Practical takes on Laravel, PHP, and AI that you can actually use.

No spam. Unsubscribe anytime. You can also follow me on X.

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

How to compile PHP from Source

thephp.website

Knowing how to compile PHP will open one of the few doors necessary for contributing to the PHP language. Once you get familiar with this it will be much easier for you to contribute in many ways such as running tests and uploading reports, writing new tests by yourself and bug reporting/fixing.

Read more [thephp.website]

🚀 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