Install Filament in a Laravel project

Prerequisites

1. Laravel installed: Ensure your Laravel version is 9.x or 10.x.
2. PHP >= 8.1: Filament requires PHP 8.1 or above.
3. Database connection: Ensure that your .env file is correctly configured with a working database.

1. Create a Laravel project (if not already installed):

composer create-project laravel/laravel your-project-name
cd your-project-name

2. Install Filament:
In your Laravel project directory, run:

composer require filament/filament

3. Publish Filament's Assets:
This will publish Filament's configuration, translations, and view files.

php artisan filament:install

4. Run Database Migrations:
Filament creates necessary tables in your database. Run:

php artisan migrate

5. Create an Admin User:
Filament requires an admin user to access the dashboard. You can create one using:

php artisan make:filament-user

You will be prompted to enter the name, email, password, and whether the user is an admin.


6. Serve the Application:
Start your Laravel development server:

php artisan serve

7. Access the Filament Admin Panel:
Open your browser and visit:

http://127.0.0.1:8000/admin

Use the credentials you set up to log in.

Optional: Customization

You can customize Filament's dashboard appearance by modifying the configuration files under config/filament.php.

For advanced customization, you can publish Filament’s views:

php artisan vendor:publish --tag=filament-views

This should successfully install and configure Filament on your Laravel application. Let me know if you encounter any issues!

Comments

Popular posts from this blog

What is filament laravel framework?

Creating Resources in Filament (Laravel Framework)