Improved dd() and dump() output in Laravel 9.32+
With the release of Laravel 9.32, dd() and dump() functions’ output has been improved. They are now showing the source file and the line where they’re called. This is super helpful if...
With the release of Laravel 9.32, dd() and dump() functions’ output has been improved. They are now showing the source file and the line where they’re called. This is super helpful if...
With the release of Laravel 9.32, the Benchmark helper was introduced. The measure() static method takes in a Closure and outputs the execution time in milliseconds. We can also pass an array of...
Let’s look at how we can add custom headers to HTTP responses in a Laravel application. Create a Middleware One good solution, in this case, is to create a Middleware. Run the following...
We’ll walk through 3 methods you can use to fix the “Error: MySQL shutdown unexpectedly” error in XAMPP. Run XAMPP as Administrator Sometimes XAMPP throws errors when you don’t run it using administrator privileges....
If you’re reading this it means you already know what XAMPP is and how to use it. You also know that there isn’t an out-of-the-box feature in XAMPP that allows you to switch between...
In this post, we’re going to find out what is a Single Action Controller, how to create one, and what are the pros and cons of using it. Let’s dive in! What...
Let’s find out how to set up Eloquent Models to use UUIDs are Primary Key in a MySQL database, instead of auto-incrementing integers. I won’t go into depth about the pros and cons of...
In this post, we’re going to implement the Repository design pattern in a Laravel application. If you’re coming from the Symfony world or any other framework that uses the Repository pattern to interact with...
We’re going to have a look, in just a few steps, at how to seed the database with data that come from a JSON file within our application. In this example, we’ll use the...
In this post, we’re going to look at a simple way of unit testing a Model’s getters and setters. We won’t go into the debate on whether or not it’s ok to write specific...