In Laravel Controllers, we often call $request->input() method, right? But also, there are specific methods for strict types: `$request->integer()`, `$request->boolean()`, and others. What is the real benefit of using them? Let me explain, with examples.
React.js is the most popular front-end JS framework. There are a few ways to use React in Laravel projects, and in this tutorial, we will cover so-called RILT stack with examples, also touching the alternative of using Next.js with Laravel API.
To achieve dynamic behavior in Laravel projects, you can use JavaScript, and Vue.js is one of the most popular solutions. This article will provide an overview for Laravel developers who hasn't started with Vue.
Seeding data in Laravel is quite simple, but also has a lot of caveats, less-known functions and use-cases. Both Seeders and Factories have so much "hidden" power that we've compiled this HUGE tutorial, with screenshots from real scenarios.
Laravel allows us to structure code in many ways, right? But with APIs, it's important to avoid some bad practices, cause it may break API clients and confuse other developers.
PostgreSQL is not the most popular DB for Laravel, but it got more attention in 2025. In this tutorial, I'll try to summarize the cases WHEN you may want to use Postgres. We will dive into the differences in features, performance, and configuration.
Laravel developers are used to Eloquent for DB operations but often need raw SQL queries to achieve their goals. In this tutorial, we gathered 20 open-source examples of Laravel projects that use MySQL-specific functions.
Polymorphic relationships are one of the most complex relationships in Laravel. In this post, let's examine eight examples from Laravel open-source projects and how they use them.
Service Providers have been the core functionality of Laravel since the beginning. However, in Laravel 11, the list of providers changed, with only `AppServiceProvider` left. So, what do developers need to know now?
Clean code is something all devs aim for, right? But what does it ACTUALLY mean? In this tutorial, I will list 6 practical tips for Laravel to write clean code.
The try-catch PHP operator is very old, and we all know its syntax. But the confusing part is WHEN to use it. In what cases? In this tutorial, I will show practical examples to explain the answer.
I recently worked with an Eloquent query with the `where status = 'new'` filter by ENUM value, which felt quite slow. I changed it to `status_id` instead. Was it faster? Let's find out together.
People keep asking me about "best practices" in Laravel. However, there are clear BAD practices. So, in this article, I will list the most common ones.
Some Laravel tasks are running in the background. What if you want to "listen" for those events to finish? Let's implement exactly this real-time feedback with the Reverb server.
Looking at Laravel job descriptions, you will find Redis quite often. This tutorial will cover the basics of using it with Laravel and how to use it in your projects.
Many Laravel developer jobs require not only creating APIs but also interacting with other 3rd-party APIs. In this lengthy tutorial, we will show four examples of such APIs.
In Laravel projects, a lot of issues come from non-Laravel mistakes, database structure is one of those. In this tutorial, we will cover the most typical mistakes devs make when structuring DB in Laravel.
Filament is great for admin panels, but what if you want to use it as an e-shop with payments? In this tutorial, we will show how to integrate Stripe one-time checkout into Filament.
File upload in Laravel is pretty straightforward, but deleting obsolete files is often overlooked. When you update Eloquent models or change data, the files stay on the server. How to clean them up? We will discuss several ways.
Once you create a Filament User resource - you will get a typical user creation form, which will instantly create a new user. What if you want to send an invitation first and allow the User to join from an email? You can do that, too, but there is some custom work needed.
Filament v3 has an awesome Infolist feature, but the components are pretty limited, like `TextEntry` or `ImageEntry`. What if you want to create your own custom entry? This tutorial will teach you how to make a custom Filament Infolist Component with custom CSS styling.
Filament has a powerful feature called Render hooks to render Blade content in various places and is especially useful for plugin developers. In this article, we will show you four practical examples of this.
Data pagination is a common feature on the web. This article will cover implementing it in Vue.js components by fetching data from Laravel API. Let's quickly implement one using the laravel-vue-pagination package. Also, we will cover the "infinite scroll" pagination.
When working with invoices, you need to deal with serial numbers that look like `ABC-000001`. Do you know how to auto-generate them in Laravel? This tutorial will cover a few ways to do this.
Livewire v3 introduced Form Objects to offload the field logic from the Component. In this tutorial, we'll build the create/edit modal forms powered by the Wire Elements package and reuse the same Livewire component and Form Object.
In Filament, adding a filter to dashboard widgets is pretty straightforward. But what if you want to have a filter that would update MULTIPLE widgets at once, similar to Google Analytics? We need to use events and Livewire properties for this. Let's take a look.
Filament 3 has authentication features that you can easily enable, like the Profile page. But its default design is the same as the login/register page. What if we want to use the full-page design, with menus, for the Edit Profile page, too? Let's see how to do it.
If you want your user to reserve an item for X minutes before confirming the purchase, this tutorial will show you how to do it, with a project of timeslot booking and reservation timer, built with TALL stack - Livewire and Alpine.
Imagine you need a system for booking appointments: doctor, hair salon, or cart racing track. In this tutorial, we will create exactly that, with a 2-in-1 demo: how to build a dynamic form in Filament and how to reuse it outside the adminpanel for non-logged-in users to be able to book an appointment.
When working with shops and e-commerce projects, one common question is how to structure the DB of products with all attributes, variants, and options, like "iPhone - Black - 2 GB RAM - 1 TB Storage". In this tutorial, we will show our version of doing that.
Which Laravel e-commerce CMS/package is the best? It's a common question on forums. We tested out FOUR popular Laravel packages for e-shops - Aimeos, Bagisto, Lunar, and Vanilo. In this tutorial, you will see who are the "winners".
Bagisto is one of the most popular Laravel e-commerce systems. In this tutorial, we will try to build a small demo e-shop with it, step-by-step, creating a custom design theme.
The `Carbon` class for dates and times is a part of Laravel by default, but there's also a less-known class, `CarbonPeriod`. It can help generate the ARRAY of datetimes, often useful for report tables and calendars. In this tutorial, let's look at the 7 most practical examples of `CarbonPeriod`.
JSON columns in the database seem like a solution if you're not sure about the structure of data. But quite often, they lead to more problems in the future. In this article, I want to show both good and bad cases of using JSON columns with Laravel examples.
When structuring a database, similar relationships may repeat, like a Task may be assigned to a User, User Group, or User Role. Is it worth thinking about polymorphic? In this example, let's compare the performance and convenience to use.
When writing automated tests, sometimes you want to repeat the same test multiple times on various data inputs. In Laravel, you can do this easily with data providers and datasets. I will show you a PHPUnit and a Pest example.
Have you ever used an external API and specified its version? For example, have you noticed the "/v1/" in the URL of "https://api.openai.com/v1/models"? In this tutorial, I will explain how to use similar versioning for our own APIs we create with Laravel.
Experienced developers often advise avoiding static methods in PHP classes. In this tutorial, let me give you a few practical Laravel/PHP examples behind this advice. When are static methods ok, and when it's best to avoid them?
In this tutorial, we will create a dashboard that will automatically refresh every 5 seconds to show the next piece of data, with an example of sports leagues tables. We will use Livewire feature polling for this.
I received an email from a person asking for help showing the table of data with dynamic columns. In this tutorial, I will show you exactly how I did it.
Filament is a great admin panel system, but it often confuses users how to create a custom non-CRUD page in Filament that wouldn't be a typical Resource? This tutorial will provide an example.
Have you ever tried to import 1 million rows from CSV into the DB? It's a tricky task that can end up with performance issues, timeouts, or just running out of server resources. In this tutorial, I will show you one way of handling this with Jobs and Queues.
In this tutorial, we will show how to add permissions to the Laravel application with Vue.js SPA architecture. For the example, we will take a basic CRUD of posts, create two roles (admin and editor), and the editor role will not be able to delete the posts.
Do you store Laravel global settings in the config files? Would you want them to be editable without touching the code? Let's build a Settings page where you can change things quickly.
Spatie Laravel MediaLibrary is a very popular package to store and associate images with models. But it has so many less-known features under the hood! Let's explore some of them.
This tutorial is a Part 2 follow-up to the "Livewire Sidebar Filters for E-Shop Products: Step-by-Step" article. We decided to improve that Sidebar Filter component with new features using Alpine.js.
Have you ever needed a checkbox-based filter for a list, like in e-shop sidebars? In this tutorial, we will use Livewire to build this step-by-step and update the products list without page refresh.
Composer is a well-known tool to manage PHP project dependencies. But I'm pretty sure you're not using all of its features! In this tutorial, we'll show many less-known capabilities of Composer.
In this tutorial, we will use Livewire to create a component for Like/Dislike, similar to YouTube or any social network. We will show the count of likes and dislikes, also minimizing the number of queries to the DB.
When creating forms it is pretty common to use two "select" dropdown fields depending on each other, with a parent-child relationship. In this tutorial, we will show to use Livewire Lifecycle Hooks to implement exactly that.
If you have two Resource Controllers like Courses and Lessons, they are often called nested resources in Laravel. In this tutorial, I will show you how to make such nested resources in Filament.
For multi-currency projects, there's no single solution. In this tutorial, we'll take a look at different approaches to this problem: DB schema, currency rate calculation, and more.
Git is an essential tool for every developer. In this tutorial, I will explain everything you need to know about branches and conflicts while working in a team, with Laravel examples.
Service classes a very popular in Laravel projects. In this tutorial, I will explain what is a Service, when/how to use it, and what should NOT be done in Services.
Wanna learn design patterns? Here's a "secret": you've all actually USED them already while working with Laravel itself. Let's see examples of patterns like Facade, Builder, and Adapter in the framework code.
In this tutorial, we will explore how to use Laravel, React, and Laravel Sanctum together to build an API authentication, in two ways: in two-in-one Laravel + React SPA, or as separate React + API projects.
PhpStorm is a powerful IDE for PHP development, with many features to write code faster and more efficiently, including refactoring your code. In this tutorial, let's look at some examples, with screenshots.
When working with files and images in Laravel, you can store them for public and private use. In this tutorial, we will explore how to do both, also looking at local server and Amazon S3 setup.
In this tutorial, we will explore how to use Laravel, Vue, and Laravel Sanctum together to build an API authentication, in two ways: in two-in-one Laravel + Vue SPA, or as separate Vue + API projects.
How should you name your Controllers: singular or plural? In this tutorial, we will cover a dozen tips for naming different things in Laravel and PHP, including Models, Controllers, Blade files, Migrations, and more.
For fixing code styling mistakes, there's a great tool called Laravel Pint. In this article, I will list one of the most typical fixes it makes, with before/after examples.
When creating an application, you will need some restrictions for your users. Laravel offers a variety of ways how to implement this. In this tutorial, I will show you four examples.
One of the quickest ways to launch a website is to use a prebuilt HTML/CSS theme, free or paid. In this tutorial, I will show step-by-step how to take such Bootstrap-based theme for a real estate project, and turn it into a Laravel project: with layout, components and Eloquent data.
Adding foreign keys can sometimes be tricky. You might get an error message or see that it doesn't work as expected. There are 3 common mistakes that we see developers make when adding foreign keys to their databases.
The performance of our applications is one of the top things we should care about. Inefficient Eloquent or DB queries are probably no.1 reason for bad performance. In this tutorial, I will show you the top 3 mistakes developers make when it comes to Eloquent performance, and how to fix them.
In this tutorial, we will create a simple search from three Models and will use Laravel Collections to combine them into one collection to show results in the front-end.
The term "multi-tenancy" has different meanings and implementations in Laravel. In this article, let's take a look at a multi-database approach, using the package stancl/tenancy: I will show you step-by-step, how to make it work.
Some Laravel tasks are running in the background and you need to check whether they are finished. But what if you didn't need to constantly check, but rather "listen" for those events to finish? Let's implement exactly this real-time feedback, with Soketi server.
Collections in Laravel are "hidden gems": not everyone is using them. They are especially effective when performing MULTIPLE operations with data - so-called "chains". I've gathered 15 real-life examples from open-source Laravel projects. The goal is not only to show the Collection methods but also the practical scenarios of WHEN to use them.
What if your customer is filling in the order form, and meanwhile the product price has changed? Or, some product becomes out of stock? We need to re-validate the quantities/prices after the submit, right? In this article, I will show you two ways: regular Laravel and more UX-friendly "live validation" with Livewire.
Some time ago I posted a tweet that went viral: it was my vision of how typical Laravel SaaS could be created, by just using the packages and tools from the community. In this article, I decided to expand and actually show you how it can be done.
When importing data from CSV or another source, you may need to check every record whether it exists in the DB already, and then update that record, otherwise create a new one. There are multiple ways to perform it.
One of the most common questions about automated testing in Laravel is how to write tests for the usage of some external API. There are three ways to do that, and I will show all of those in this article.
One of the most common questions I see about Laravel is how to structure the project. Or, in other words, where to put the logic out of the Controllers? In this article, I will try to show the options, trying to shorten one Controller method as an example.
If you want to search in multiple Eloquent models - like posts, videos, and courses - there are a lot of different ways, with or without external packages and tools. Let's explore them in this article.
Filament is an awesome rapidly growing adminpanel platform that includes table builder, form builder, and more features. But also there are many plugins that add even more functionality. Let's explore some of the best ones, in this article.
If you want to replace DB auto-increment IDs with something more sophisticated, one of the solutions is UUID. In this article, I will show you how UUID columns work in Laravel, and what are the options and tools to use them.
Historically, PHP has been a "loosely typed" language, with auto-converting between strings/integers and potential "magic" or bugs because of that. Slowly, the language itself evolved with type-hinting and return types, but also more people started to create their own object types, to define their object rules for minimizing bugs. These are called VALUE OBJECTS, and in this article, we'll cover when/how to use them.
When it comes to the performance of the Laravel application, by far the no.1 problem I've seen is the database. DB Structure, Eloquent/SQL queries, and configuration - they all may cause many issues, so in this article, I've tried to compile "the ultimate guide" of what you need to know.
Deploying changes of your Laravel project to the server is not a simple process. I would separate that into 4 separate steps, or phases: code changes, dependencies, DB changes, and environment cleanup. Let's take a look at all of them, one by one.
When working with money in your Laravel projects, whether it's product prices or invoice total order amounts, we need to be extremely careful not to miscalculate something. Luckily, there are best practices and tools to help us with that, let's explore them in this article.
Back in 2017, Adam Wathan made a great talk at Laracon called CRUDdy By Design, which has been recommended and reshared online for years. I decided to summarize it in text form, so instead of watching all 40 minutes, you could read this quicker, also with more examples and my own opinion.
Eloquent is a great feature of Laravel, but also great is the list of packages that add more features on top of the framework. Let's explore them, in this article!
The title says 20 packages, but there are quite a few alternatives mentioned along the way, so the actual number is even bigger than this. Ready? Let's jump in!
These days, security is very important. That's why many applications implement two-factor authentication. In this tutorial, I will show you how to do that in Laravel, using Laravel Notifications and sending a one-time password via email or SMS.
One of the most popular simple JavaScript libraries for charts is [Chart.js](https://www.chartjs.org/). Let's see how to use it in Laravel, with three practical examples: bar, line, and pie charts.
Today let's make a step-by-step tutorial on how to use a Laravel Breeze starter kit and prepare the fundamentals to separate the role-based areas: so students, teachers, and admins could have separate design layouts, menus, and routes.
There are a lot of textarea so-called WYSIWYG editors on the market. In this article, I took 4 popular ones - CKEditor, TinyMCE, Trix and Quill - and explained how to add them to a Laravel project, also adding a file/image upload feature in each case. Let's look at those examples.
React.js is one of the most popular front-end frameworks, but it lacks examples of how to integrate it with Laravel API. So, in this long article, I will show you how to do it in details, step-by-step.
For file uploads, there's a very popular JavaScript library called FilePond. How to use it in Laravel? We'll talk about using it in create/edit forms, previewing the images, and then will try to use tools like Spatie Media Library, Amazon S3 and Livewire.
Laravel has a few starter kits like Breeze and Jetstream, but they don't have roles/permissions functionality. This time, let's talk specifically about Vue Inertia versions of those starter kits: how to add the roles and permissions there?
There are quite a lot of articles/videos on Laravel + Vue CRUD, but not enough is published on the newest Vue.js 3 version, using the new Composition API. So, with this step-by-step detailed article, let's fill in that gap, building a simple Company management form.
API-based projects are more and more popular, and they are pretty easy to create in Laravel. But one topic is less talked about - it's error handling for various exceptions. API consumers often complain that they get "Server error" but no valuable messages. So, how to handle API errors gracefully? How to return them in "readable" form?