Skip to main content

Overview

Filament Resources are the primary way to manage your data in the admin panel. They provide out-of-the-box functionality for listing, creating, editing, and deleting records.

Creating a Resource

Resources are located in src/Filament/Resources. Use the Filament command to scaffold:
php artisan make:filament-resource Product
This creates a resource class with list, form, and detail page configurations.

Resource Contract

Always define a contract for each Filament Resource in Esign\UnleashCommerce\Admin\Contracts\Filament\Resources:
interface ProductResourceContract
{
    // Define your contract methods
}

Registering Resources

Register replacements via the FilamentResourceManifest to allow swapping implementations.

Tables

Configure your resource table with columns, filters, and actions:
public static function table(Table $table): Table
{
    return $table
        ->columns([
            Tables\Columns\TextColumn::make('name'),
        ])
        ->actions([
            Tables\Actions\EditAction::make(),
        ]);
}

Forms

Define your form schema for creation and editing:
public static function form(Form $form): Form
{
    return $form
        ->schema([
            Forms\Components\TextInput::make('name')
                ->required(),
        ]);
}

Documentation

For detailed information about Filament Resources, see the Filament documentation.