Filament is a modern, powerful, and easy to integrate PHP admin panel builder for Laravel applications. It allows developers to create beautiful, responsive admin dashboards with minimal effort using Laravel, Livewire, and Tailwind CSS. This article focuses on the installation process to get Filament up and running quickly in your Laravel project.
Prerequisites
Before installing Filament, ensure you have the following requirements met:
- PHP 8.2 or higher
- Laravel version 11.28 or higher
- Initial Laravel application
Install Filament via Composer
In this installation process, We will use composer to install filament package. We will use latest Filament version for this example. Open your terminal enter below command into it.
composer require filament/filament:"^4.0"
This command installs the core Filament package and its dependencies.
Setting Up the Filament Panel
Filament offers two modes: the full admin panel builder or individual components for Blade views. For most use cases, installing the panel builder is recommended as it provides a cohesive and powerful admin interface.
php artisan filament:install --panels
It will create and automatically register service provider into Laravel application. That will be located at app/Providers/Filament/AdminPanelProvider.php. In some cases, you have to manually add this provide into provider.php file. Please check this before moving further.
The default route will be /admin. Install necessary CSS and JavaScript assets, including Livewire and Tailwind CSS integration.
Create an Admin User
To access the admin panel, you need a user account. Filament provides in-built command to generate panel user. You can use below command to create user for panel :
php artisan make:filament-user
You will be prompted to enter a name, email, and password for the new user. This user can log in to the admin panel at /admin
in your browser.
Access and Explore Your Admin Panel
To check and test you need to run Laravel development server if not running.
php artisan serve
Then visit http://localhost:8000/admin
(or your app’s domain plus /admin
) in your web browser. Use the credentials created previously by command line and start building your app with Filament.
With these steps, installing and setting up Filament in Laravel is straightforward, helping developers quickly create powerful admin panels easily.
Conclusion
Installing Filament in a Laravel project is a straightforward process that equips developers with a modern, fully-featured admin panel solution. With just a few commands, Filament integrates seamlessly into Laravel, providing a beautiful interface built on Livewire and Tailwind CSS. Creating admin users and accessing the ready-to-use panel is simple, enabling rapid development and management of application data.
Here are key commonly used admin panel features to set up initially in Filament, including global search and resource management:
- Enable and configure Global Search to search across all resources from anywhere in the admin panel.
- Create and register Resources for your Laravel models to enable CRUD operations in the admin.
- Set up navigation menus to organize access to different resources and pages.
- Configure user authentication and roles for access control and permission management.
- Add Dashboard Widgets for quick stats and metrics on the admin home page.
- Customize Tables and Forms within resources to tailor data input and display.
- Enable Notifications and Alerts for important admin events.
- Integrate Multi-tenancy or Multiple Panels if managing separate admin scopes.
- Customize theme, layout, and branding for a polished admin interface.
For a detailed guide on search customization, read our blog How to Add and Customize Global Search in Filament to improve results, fields, and user experience.