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

Oh Dear 2.0 has been launched

Original – by Freek Van der Herten – 27 minute read

I'm proud to announce that we have launched a redesigned Oh Dear. If you're unfamiliar with Oh Dear, it's the best all-in-one monitoring tool for your entire website. You can register for a 10-day free trial.

You can help us spread the good news by upvoting us on Product Hunt, or retweeting our launch tweet.

In this blog post, I'd like to share what Oh Dear can do for you, how we've rebuilt various parts, and give you an overview of the technology behind the service.

screenshot

Read more

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

You can follow me on these platforms:

On all these platforms, regularly share programming tips, and what I myself have learned in ongoing projects.

Every month 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.

A package to manage dynamic servers

Original – by Freek Van der Herten – 6 minute read

I'm proud to announce that our team has released a new package called laravel-dynamic-servers.

This package can help start and stop servers when you need them. The prime use case is to spin up extra working servers to help you process the workload on queues.

In this blog post, I'd like to introduce the package to you.

Read more

Creating installer commands for Laravel packages

Original – by Freek Van der Herten – 5 minute read

One of the joys of using packages in the Laravel ecosystem is how easy they are to install. Packages can be pulled in using Composer, and Laravel will automatically discover them.

In this post, you'll learn how to easily add an install command, making it even easier for package users to start using a package.

Read more

Increase performance by using Eloquent's `setRelation` method

Original – by Freek Van der Herten – 5 minute read

While working on the upcoming Oh Dear redesign, I noticed that list that displays all sites of a team was very slow.

To display that list, a lot of queries were used. With a couple of minor adjustments, I could reduce the number of queries needed to just a single one, solving the performance problem.

In this small blog post, I'd like to share one of the techniques I used.

Read more

Introducing our new Laravel Options package

Original – by Ruben Van Assche – 2 minute read

When developing web applications, you probably encounter a lot of places where someone needs to select one or more options in a select or multi-select. These select boxes always need a list of options with labels and values.

In one of our projects, we had options being generated in lots of places. Sometimes these lists of options were the same, leading to a lot of code duplication. Even worse, in some cases, different formats were used to output the same options.

That's why we've created a new package called spatie/laravel-options. It will take a resource which can create options such as an enum, a list of models or even a plain array. And will always create a standardized array of options you can use within your frontend application.

Read more

Using Laravel Vite to automatically refresh your browser when changing a Blade file

Original – by Freek Van der Herten – 2 minute read

Yesterday, the Laravel team released the vite-plugin. Going forward, Vite will become the standard build tool for Laravel apps.

One of the cool features of this Vite integration is that you'll get hot reloading by default. Whenever you run Vite with npm dev and modify a JS or CSS file, Vite will automatically recompile the assets and refresh your browser. This way, you won't have to refresh your browser manually after making a change.

Wouldn't it be cool if this automatic refresh would work when we're changing a Blade file?

Read more

Making Vite and Valet play nice together

Original – by Freek Van der Herten – 3 minute read

Yesterday, the Laravel team launched the official vite-plugin. From now on, Vite will be the standard build tool for Laravel. The main benefits are vastly improved build times and a more straightforward API. Want to know more about it? Head over to the official docs. There's also a migration guide to go from Mix to Vite.

When I followed that guide to upgrade the freek.dev codebase from Mix to Vite , npm dev could successfully start-up Vite, but in the browser the JS / CSS did not load. Let's review how I could fix that.

Read more

Using the `Attachable` interface to attach any kind of object to a mail in a Laravel app

Original – by Freek Van der Herten – 4 minute read

Laravel 9 has gained a excellent new way to attach files in mails. Using the Attachable interface, you can specify what should happen when an object gets used as an attachment.

Using our media library package you can easily associate any file with an Eloquent model. We've added support for Laravel's Attachable in the latest version of the package.

In this blog post, I'd like to tell you all about it.

Read more

A package to add comments to your Laravel app

Original – by Freek Van der Herten – 10 minute read

I'm proud to announce that our team has released a new premium package called Laravel Comments. Using this package, you can set up a comments section in your Laravel app in no time.

We've made a nice, errr I mean epic launch movie to get you in the right mood.

Laravel Comments includes a Livewire component to render comments. Here's what it looks like:

screenshot

Of course, we wrote extensive documentation, covering every aspect of Laravel Comments.

It comes with batteries included:

  • comments can be nested
  • emoji reactions
  • notifications to all participants when a new comment is posted
  • an inline approval flow for new comments
  • markdown editing and code highlighting
  • endlessly customisable

In this blog post, I'd like to introduce the package to you.

Read more

A package to create Livewire powered wizards in no time

Original – by Freek Van der Herten – 9 minute read

I'm proud to announce that our team has released a new package called laravel-livewire-wizard. Using this package, you can set up multi-step wizards quickly using Livewire.

The package is headless, which means that it provides no UI itself, but it makes it easy to build any UI you desire.

You can easily control which step is displayed, access state of other steps, and build any navigation you desire.

I'd like to introduce the package to you in this blog post.

Read more

How to add a spotlight-like search field to your Laravel app

Original – by Freek Van der Herten – 6 minute read

As developers, we tend to like shortcuts to speed up our workflow. One of the tools I'm using to speed up doing stuff on my Mac is Raycast. It offers a lovely command palette that allows opening apps and URLs, working with clipboard history, and much more.

Wouldn't it be nice to also add such a command palette to a Laravel app? This way, power users of your app can get around quickly and perform small tasks without having to click around.

The good news is that there's already a package to add such a thing: Spotlight by Philo Hermans. In this blog post, I'd like to show how we use this fantastic package at Oh Dear.

Read more

Learn how to write readable PHP that is a joy to maintain

Original – by Freek Van der Herten – 8 minute read

I'm proud to announce that our new premium course on writing readable PHP is now available. It's called Writing Readable PHP.

This course contains a collection of bite-size tips (both in written form and videos) that make your code a joy to read for your co-workers and future self. These tips are aimed towards developers who know the basics of PHP and want to improve their craft. As a bonus, you'll learn to use static analysis to ensure that your code is understandable and correct.

Writing Readable PHP has been created by our team and Christoph Rumpel. It contains our combined knowledge on how to write the best PHP possible.

Read more