Add Customer resource to Filament admin panel: Implemented Customer model, resource, and associated pages (create, edit, list). Defined customer form schema and table configuration. Added migration for customers table.

This commit is contained in:
Ümit Tunç
2025-09-27 13:24:45 -03:00
parent 394fae1e79
commit 9dbc99200b
8 changed files with 257 additions and 0 deletions
@@ -0,0 +1,44 @@
<?php
namespace App\Filament\Admin\Resources\Customers\Schemas;
use Filament\Schemas\Schema;
class CustomerForm
{
public static function configure(Schema $schema): Schema
{
return $schema
->components([
\Filament\Forms\Components\TextInput::make('name')
->required()
->maxLength(255),
\Filament\Forms\Components\TextInput::make('email')
->email()
->required()
->unique(ignoreRecord: true)
->maxLength(255),
\Filament\Forms\Components\TextInput::make('phone')
->tel()
->maxLength(255),
\Filament\Forms\Components\Textarea::make('address')
->maxLength(65535)
->columnSpanFull(),
\Filament\Forms\Components\TextInput::make('city')
->maxLength(255),
\Filament\Forms\Components\TextInput::make('country')
->maxLength(255),
\Filament\Forms\Components\Select::make('status')
->options([
'active' => 'Active',
'inactive' => 'Inactive',
'pending' => 'Pending',
])
->default('active')
->required(),
\Filament\Forms\Components\Textarea::make('notes')
->maxLength(65535)
->columnSpanFull(),
]);
}
}