Update CustomerResource.php

This commit is contained in:
Bozhidar Slaveykov 2024-04-06 20:53:29 +03:00
parent 3c4733b730
commit 98e679268a

View file

@ -33,8 +33,12 @@ class CustomerResource extends Resource
$schema = [];
if ($getPhyreServers->count() > 0) {
$schema[] = Forms\Components\Select::make('phyre_server_id')
->label('Server')
->options($phyreServers)
->default(0)
->disabled(function($record) {
return $record->phyre_server_id > 0;
})
->columnSpanFull();
}
@ -43,6 +47,7 @@ class CustomerResource extends Resource
Forms\Components\TextInput::make('name')
->prefixIcon('heroicon-s-user')
->required()->columnSpanFull(),
Forms\Components\TextInput::make('username')
->unique(Customer::class, 'username', ignoreRecord: true)
->prefixIcon('heroicon-s-user')