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:
@@ -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(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user