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

Selling digital products using Laravel part 5: Using Satis to install private packages

Original – by Freek Van der Herten – 7 minute read

Some of our products, like Mailcoach and Media Library Pro, are PHP packages for which people can buy a time-limited license. Of course, we want customers to be able to install our paid packages using Composer. Our paid packages are not registered on Packagist, because Packagist is meant to be used for free packages, and there's no way to handle licenses. Let's take a look at how we can solve this using Satis.

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.

Why and how you should monitor scheduled tasks

Original – by Freek Van der Herten – 10 minute read

Oh Dear is the monitoring SaaS that my buddy Mattias and I are running. As you might suspect, our service can monitor the uptime of sites and SSL certificates' health. What sets Oh Dear apart from the competition is that it can also monitor performance and detect broken links and mixed content on any of the pages of your site.

Today, we added a new type of monitoring: scheduled tasks monitoring. Oh Dear can now notify you whenever one of your scheduled tasks has not run or is running too late.

You can get started monitoring your schedule today. We have a free ten-day trial. And when using this coupon code, you'll get 30% off on the first three months when subscribing: MONITOR-ALL-THE-THINGS.

In this blog post, I'd like to introduce how you can use scheduled task monitoring in Oh Dear, and how it works under the hood. There were a lot of interesting challenges we had to solve. I hope you're ready to dig it.

Read more

How to call an overridden trait function

Original – by Freek Van der Herten – 3 minute read

Traits are a wonderful thing in PHP. You can use them to reduce code duplication by putting common functions in a trait and apply them to all classes where those functions are needed. I also sometimes use traits to break up a large function in multiple single-use traits.

In this post, I'd like to show you how you can override a trait function and call it from the overriding function.

Read more

Introducing Laravel Beyond CRUD: a way of building large Laravel applications

Original – by Freek Van der Herten – 4 minute read

It's funny how from the outside, IT is often seen as an exact science. When starting as a developer, I often heard people say: "Oh, you're in IT, so you must be good at mathematics". I never understood why someone who is supposedly good at mathematics is the right person to fix a printer.

When you have some experience building applications, you know that IT is not an exact science. There are multiple valid solutions to a problem. Take five developers and ask them what the best way to set up a blog is. You'll likely get five different answers. Each suggestion will have its own set of tradeoffs.

Read more

How to group queued jobs using Laravel 8's new Batch class

Original – by Freek Van der Herten – 14 minute read

Laravel 8 offers a shiny new way to group multiple jobs into one batch. This will allow you to easily check how many job there are in a batch, what to total progress is and even cancel all jobs in a batch.

In this blog post, I'd like to share how we will use this feature in the upcoming v3 of Mailcoach. We'll also take a look at how batches are implemented under the hood in Laravel.

Read more

Using Blade components for handling layouts

Original – by Freek Van der Herten – 1 minute read

Blade components are a wonderful feature of Laravel. In most examples you can see them being used for small UI elements. Did you know you can use them for layouts as well? Want to see more videos like this one? Head over to the Readable Laravel video series on our website.

Read more

Watch the recording of Laravel Meetup #1

Original – by Freek Van der Herten – 2 minute read

Yesterday, the very first Laravel Worldwide Meetup was held. At the event, which was live streamed on YouTube, Joseph Silber gave an introduction to lazy collections. Mohamed Said demonstrated some very powerful additions coming to queues in Laravel 8.

You can watch a recording of the meetup below.

Read more

Introducing Laravel Schedule Monitor

Original – by Freek Van der Herten – 12 minute read

Since version 5, Laravel has a built-in scheduler to perform tasks at regular intervals. In normal circumstances, these scheduled tasks will run just fine.

Out of the box, Laravel doesn't offer a way to see the status of the scheduled tasks. When did they run, how long did a task run, which tasks did throw an exception?

Laravel Schedule Monitor is a new Spatie package that monitors all schedule tasks in a Laravel app. In this blog post, I'd like to introduce the package to you.

screenshot

Read more

Announcing the Laravel Beyond CRUD video course and book

Original – by Freek Van der Herten – 4 minute read

I'm proud to announce our team is creating a new video course called Laravel Beyond CRUD. In this course, you'll learn various patterns to build a large scale Laravel app with your team. Even if you're not working on large Laravel apps, there are lots of things to learn to improve your projects.

This course will be offered as a premium video course, and as a book. The course will be presented by Brent, who is in the lead at various large scale client projects at Spatie. The book, also written by Brent, is beautifully designed by my colleague Seb.

At the Laravel Beyond CRUD website, you can subscribe to our email list. We'll notify you as soon as the course is available in September. We'll also mail you an extra preview.

Read more

Announcing the Laravel Worldwide Meetup

Original – by Freek Van der Herten – 3 minute read

I'm happy to announce the official Laravel Worldwide Meetup. This monthly meetup will be streamed via YouTube. The first edition will be held on 14th July at 18:00 UTC.

There is a select group of people, sometimes jokingly referred to as "The Elite" that you often see speaking at Laracons and other events. Even though you will probably see some of these fine artisans on the stream, the main goal of this meetup is to introduce new speakers to the community.

Read more

Adding try/catch to Laravel collections

Original – by Freek Van der Herten – 6 minute read

A few weeks ago, Jmac tweeted out an excellent idea. What if we could use try and catch in a collection chain?

Meanwhile, Jmac and I did a few code pairing sessions to work on a possible implementation. We've added try and catch methods to the laravel-collection-macros package.

In this blog post, I'd like to share what you can do with these methods and how they work under the hood.

Read more

A package to schedule Artisan commands at sub-minute frequencies

Original – by Freek Van der Herten – 3 minute read

Laravel's native scheduler allows you to schedule Artisan commands to run every minute. For a project I'm working on I needed to schedule a command to run every few seconds. I found a good solution to do this using an ReactPHP powered event loop. Because this solution could be helpful for others as well, I decided to package it up.

Using the laravel-short-schedule package, you can schedule artisan commands to run every second or even lower frequencies. In this blogpost I'd like to introduce the package.

Read more