5 Laravel Database Optimizations That Actually Matter in Production

Laravel apps often feel fast at first, but slow down as real users and data grow. In most cases, the issue isn’t the framework but it’s inefficient database queries. This article covers a few practical optimizations that can make a noticeable difference in real-world performance. Fix N+1 Queries (Eager Loading) The N+1 query problem occurs … Read more

How to Reuse a Base Query in Laravel Without Modifying the Original (Using clone)

When writing queries in Laravel, its common to run similar database queries with only small differences in conditions. For example, imagine you need to calculate : A common approach is to write separate queries for each case. In the above queries, the same conditions are repeated, harder to maintain and also violates DRY principle. Common … Read more

How to Add Row Index / Serial Number in Filament Table

In this guide, we will see how we can add row index in filament table. Problem By default, Filament tables do not show row numbers.In many admin panels, users expect to see a serial number / index column (1, 2, 3…) for better readability. Solution You can easily add an index column using Filament’s TextColumn … Read more

How to Show Different Stats Widgets to Different Roles in FilamentPHP

When building dashboards in FilamentPHP, you may want to display different stats widgets to different user roles.For example: Filament makes this very easy by using simple role or permission checks inside your widget. 1. Create your StatsOverviewWidget The above command will generate the StatsOverview file. Permission Hide the entire widget Lets say, we want to … Read more

How to add nested resources in filament?

In this guide, we will explore how we can add nested resources in filament panel. This feature was introduced in filament v4. Setup model to add nested resources in filament For nested resources, we will have 4 models. The relationship for above is: I’ve used this approach in the backend of my mobile app — … Read more

How to add Language switcher in filament?

add language switcher in fialment

In this guide, we will explore how we can add language switcher in filament. There are some packages like kenepa/translation-manager-plugin, bezhanSalleh/filament-panel-switch to add language switcher in filament instantly with additional features. But in this article, we will add our own. Here is an article to add Language switcher in fialment using kenepa/translation-manager-plugin. Storing lang You … Read more

How to add Tabs on custom filament page?

In this guide, we will explore how we can add tabs on custom filament page. Create a page to add tabs on custom filament page To create a new filament page, just hit the following commad: You can explore more about creating filament custom page in this article. Implement HasTable Second step will be to … Read more

Mastering Enums in Laravel Filament: A Complete Guide with Practical Examples

mastering enum in laravel

Learn how to use enums in Laravel Filament to simplify your code, improve validation, and manage fixed values efficiently. This complete guide covers practical examples, best practices, and tips to boost your Laravel development. Learn more about enums here. Introduction to Enums in Laravel Filament In many Laravel apps, we often use strings like ‘pending’ … Read more

How to Set Up Email Authentication in Filament Admin Panel

Set Up Email Authentication in Filament Admin Panel

Set Up Email Authentication in Filament Admin Panel to keep your admin panel secure. By sending a unique code to the user’s email at every login, you ensure only authorized users can access your system. This adds an extra layer of protection while keeping the login process simple and user-friendly. Setup Filament If you haven’t … Read more