Filament PHP: The Complete Beginner’s Guide (2025)

Author

Kritim Yantra

Mar 30, 2025

Filament PHP: The Complete Beginner’s Guide (2025)

If you're looking for an easy way to build admin panels in Laravel without writing tons of code, Filament PHP is the perfect solution!

In this step-by-step tutorial, we’ll cover:
What Filament is and why it’s awesome
How to install and set up Filament
Creating a full admin dashboard
Managing data with CRUD operations
Customizing your admin panel

By the end, you’ll have a working admin panel—no advanced coding skills needed!


What is Filament PHP?

Filament is a free, open-source admin panel builder for Laravel. It helps you quickly create:
🔹 User dashboards
🔹 Database management systems
🔹 Content management panels

Why Use Filament?

No frontend coding (uses Livewire & Tailwind)
Pre-built forms, tables, and widgets
Super fast to set up
Great for beginners & pros alike


Step 1: Installing Filament in Laravel

Prerequisites

  • Laravel 10+ (or Laravel 12)
  • PHP 8.2+
  • Composer

1. Create a New Laravel Project

composer create-project laravel/laravel filament-demo
cd filament-demo

2. Install Filament

composer require filament/filament:"^3.3" -W

3. Set Up the Admin Panel

php artisan filament:install --panels

This creates:

  • A new /admin route
  • Default Filament admin files

Step 2: Creating an Admin User

Run:

php artisan make:filament-user

Enter your name, email, and password.

Now, start the server:

php artisan serve

Visit http://localhost:8000/admin and log in!


Step 3: Building a Product Management System

Let’s create a simple product manager (like a mini e-commerce dashboard).

1. Create a Product Model & Migration

php artisan make:model Product -m

Edit the migration (database/migrations/..._create_products_table.php):

Schema::create('products', function (Blueprint $table) {
    $table->id();
    $table->string('name');
    $table->text('description');
    $table->decimal('price', 8, 2);
    $table->timestamps();
});

Run the migration:

php artisan migrate

2. Generate a Filament Resource

This creates CRUD (Create, Read, Update, Delete) operations automatically!

php artisan make:filament-resource Product --generate

Now, visit /admin/products—you’ll see a ready-to-use product manager!


Step 4: Customizing the Admin Panel

1. Changing the Brand Logo

Edit app/Providers/Filament/AdminPanelProvider.php:

use Filament\Panel;

public function panel(Panel $panel): Panel
{
    return $panel
        ->brandName('My Shop Admin')
        ->brandLogo(asset('images/logo.png'));
}

2. Adding a Dashboard Widget

Create a new widget:

php artisan make:filament-widget StatsOverview

Edit app/Filament/Widgets/StatsOverview.php:

protected function getStats(): array
{
    return [
        Stat::make('Total Products', Product::count()),
        Stat::make('Latest Product', Product::latest()->first()?->name),
    ];
}

Now, it appears on your dashboard!


Bonus: Adding User Permissions

Want to restrict access? Update app/Models/User.php:

use Filament\Models\Contracts\FilamentUser;

class User extends Authenticatable implements FilamentUser
{
    public function canAccessPanel(Panel $panel): bool
    {
        return $this->is_admin; // Only admins can access
    }
}

Final Thoughts

🎉 Congratulations! You’ve built a fully functional admin panel with:
Product management
A custom dashboard
User access control

Next Steps?

🔹 Explore Filament’s official docs
🔹 Try adding image uploads or user roles
🔹 Deploy your panel to a live server


Enjoyed this guide? Share it with fellow developers! 🚀

Got questions? Drop them in the comments below! 👇

LIVE MENTORSHIP ONLY 5 SPOTS

Laravel Mastery
Coaching Class Program

KritiMyantra

Transform from beginner to Laravel expert with our personalized Coaching Class starting June 20, 2025. Limited enrollment ensures focused attention.

Daily Sessions

1-hour personalized coaching

Real Projects

Build portfolio applications

Best Practices

Industry-standard techniques

Career Support

Interview prep & job guidance

Total Investment
$200
Duration
30 hours
1h/day

Enrollment Closes In

Days
Hours
Minutes
Seconds
Spots Available 5 of 10 remaining
Next cohort starts:
June 20, 2025

Join the Program

Complete your application to secure your spot

Application Submitted!

Thank you for your interest in our Laravel mentorship program. We'll contact you within 24 hours with next steps.

What happens next?

  • Confirmation email with program details
  • WhatsApp message from our team
  • Onboarding call to discuss your goals

Comments

No comments yet. Be the first to comment!

Please log in to post a comment:

Sign in with Google

Related Posts