fixed filament resource forms
This commit is contained in:
@@ -7,9 +7,15 @@ use App\Models\Tenant;
|
||||
use Filament\Resources\Resource;
|
||||
use Filament\Tables;
|
||||
use Filament\Tables\Table;
|
||||
use Filament\Actions;
|
||||
use Filament\Forms;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Schemas\Schema;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
use Filament\Forms\Components\Toggle;
|
||||
use Filament\Forms\Components\KeyValue;
|
||||
use UnitEnum;
|
||||
use BackedEnum;
|
||||
use Filament\Actions;
|
||||
|
||||
class TenantResource extends Resource
|
||||
{
|
||||
@@ -18,6 +24,34 @@ class TenantResource extends Resource
|
||||
protected static UnitEnum|string|null $navigationGroup = 'Platform';
|
||||
protected static ?int $navigationSort = 10;
|
||||
|
||||
public static function form(Schema $form): Schema
|
||||
{
|
||||
return $form->schema([
|
||||
TextInput::make('name')
|
||||
->label('Tenant Name')
|
||||
->required()
|
||||
->maxLength(255),
|
||||
TextInput::make('slug')
|
||||
->label('Slug')
|
||||
->required()
|
||||
->unique(ignoreRecord: true)
|
||||
->maxLength(255),
|
||||
TextInput::make('contact_email')
|
||||
->label('Contact Email')
|
||||
->email()
|
||||
->required()
|
||||
->maxLength(255),
|
||||
TextInput::make('event_credits_balance')
|
||||
->label('Event Credits Balance')
|
||||
->numeric()
|
||||
->default(0),
|
||||
KeyValue::make('features')
|
||||
->label('Features')
|
||||
->keyLabel('Key')
|
||||
->valueLabel('Value'),
|
||||
])->columns(2);
|
||||
}
|
||||
|
||||
public static function table(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
|
||||
Reference in New Issue
Block a user