Close
Stay up to date with all things Laravel, Tailwind, WordPress & PHP

Subscribe now to my e-mail newsletter and get my latest articles and project updates delivered directly to your inbox. Never miss an update.

How to keep Laravel Horizon active with a cron job (New package)

Published October 15, 2021
How to keep Laravel Horizon active with a cron job (New package)

Laravel Horizon is a great tool for managing and monitoring your Redis queues in Laravel. It allows you to spin up queues fast and make use of all the awesome Laravel Queue features.

However, there’s one downside to Laravel Horizon. That downside is that Laravel Horizon does not restart the queues automatically if the process was terminated for some or the other reason.

Consider the scenario that you have a queue running,

Laravel Eloquent relationships for beginners – Full 2021 Guide

Published October 5, 2021
Laravel Eloquent relationships for beginners – Full 2021 Guide

Laravel Eloquent is one of the flagship features of the Laravel framework. In part that is also thanks to its awesome support for defining, creating and managing relationships between different tables of data. In this tutorial I’ll show you how to create and use Eloquent relationships, so that you can get up and running without any previous knowledge of relationships.

What are database relationships?

First, let’s start with the absolute basics. What is a relationship exactly?

How to manage DateTime with Carbon in Laravel & PHP

Published September 10, 2021; last updated on October 1, 2021
How to manage DateTime with Carbon in Laravel & PHP

At some point, almost every Laravel application needs to work with dates and times. But managing dates and times is sometimes ridiculously complex, because of timezones. In which timezone do you store dates and times? How do you calculate differences between times?

Luckily, there’s Carbon: a simple PHP API extension for DateTime. That might sound very complex, but it really isn’t. Laravel uses Carbon by default, but the documentation barely talks about it.

Laravel Eloquent for Beginners | Full guide (2021)

Published September 3, 2021; last updated on September 10, 2021
Laravel Eloquent for Beginners | Full guide (2021)

Laravel Eloquent is one of Laravel’s flagship features and one of the most notable things that distinguishes Laravel from other PHP frameworks. The Laravel Eloquent ORM is a way to interact with your database. In this tutorial I’ll show you the basics of using Laravel Eloquent, so that you can start using Eloquent quickly.

So, what is Eloquent exactly? Or what is an Eloquent model? It effectively comes down to the following: for each table you have in your database,

Laravel Databases & Migrations for Beginners (2021)

Published August 20, 2021; last updated on September 10, 2021
Laravel Databases & Migrations for Beginners (2021)

Laravel provides a whole bunch of tools to interact with your application’s database. The most important one is Eloquent, which is one of Laravel’s most popular and influential features. In a world of powerful, but complex tools, Eloquent stands out for its simplicity. But before we dive into Eloquent, it’s a good idea to first get everything set up and understanding the basics of Laravel’s database functionality: connections & migrations.

In this tutorial,

How to use Browsersync with Laravel Valet (2021)

Published August 3, 2021; last updated on September 10, 2021
How to use Browsersync with Laravel Valet (2021)

If you’re a developer in the PHP world, it’s likely that you’ve come across Laravel Valet. Laravel Valet is a very easy way to spin up multiple local development environments, by linking a folder name to a {folderName}.test domain.

Browsersync is a tool to make developing easier. It offers handy tools, of which the most important is automatic browser reloading on file change. Unfortunately Browsersync doesn’t work out-of-the-box with Laravel Valet, but luckily it requires only a little configuration.

How to validate Laravel user input for beginners (2021)

Published July 23, 2021; last updated on September 10, 2021
How to validate Laravel user input for beginners (2021)

Laravel is by far the most popular PHP framework, due to its enormous flexibility, awesome community and shallow learning curve. Handling and validating user input is perhaps one of the most important things in Laravel. In this article I’ll show you the three methods for validating user input.

For this article I’ll assume you already have a form and something similar to the following two routes:

use App\Http\Controllers\PostController;

Route::get(‘/post/create’, [PostController::class, ‘create’]);
Route::post(‘/post’,

How to rollback the latest Laravel database migration(s)

Published June 29, 2021; last updated on July 5, 2021
How to rollback the latest Laravel database migration(s)

Building Laravel database migrations that are good right away is hard – especially for beginners. That’s why you’d often want to make a change to your migration, only to discover that you’ve already migrated your database. Luckily, it’s very easy in Laravel to correctly rollback only your last database migration(s).

First, let’s just check which database migrations we’ve already run. To do so, run the command php artisan migration:status on the command line (make sure to navigate to the directory with your application files first).

How to check your Laravel database connection

Published April 16, 2021; last updated on September 10, 2021
How to check your Laravel database connection

Laravel is a great framework for rapid application building. It allows you to easily connect to a database. If you’re developing locally, chances are that you need to confirm that the application is connected to a database, for example when you’re debugging something.

In this tutorial I’ll show you how to check which database your Laravel app is connected to.

There is a simple code snippet to check the name of the current database connection,

How to use Tailwind CSS v2.1 JIT compiler with Laravel Mix

Published April 12, 2021; last updated on July 15, 2021
How to use Tailwind CSS v2.1 JIT compiler with Laravel Mix

Last week Tailwind CSS released version 2.1.0. One of the best features of the release is the fact that the new Just-In-Time (JIT) compiler is now included in the official build. In this tutorial I’ll show you how to use the Tailwind CSS JIT compiler with Laravel Mix. Best of all is that it takes less than two minutes🚀

The compiler is a huge step forward in the development of Tailwind CSS. There are several important advantages,