fix: enforce unique national ID validation and fix sync updated_at corruption
This commit is contained in:
@@ -195,7 +195,15 @@ public static function form(Schema $schema): Schema
|
||||
TextInput::make('icno')
|
||||
->label(__('patients.fields.icno'))
|
||||
->required()
|
||||
->maxLength(11),
|
||||
->maxLength(11)
|
||||
->unique(
|
||||
table: Patient::class,
|
||||
column: 'icno',
|
||||
ignorable: fn ($record) => $record,
|
||||
)
|
||||
->validationMessages([
|
||||
'unique' => __('patients.validation.icno_unique'),
|
||||
]),
|
||||
|
||||
TextInput::make('hand_phone')
|
||||
->label(__('patients.fields.hand_phone'))
|
||||
@@ -807,7 +815,7 @@ public static function table(Table $table): Table
|
||||
->iconColor(fn ($state) => $state ? 'success' : 'gray')
|
||||
->placeholder('-'),
|
||||
])
|
||||
->defaultSort('created_at', 'desc')
|
||||
->defaultSort('updated_at', 'desc')
|
||||
->recordActions([
|
||||
Action::make('surgeryAppointment')
|
||||
->label(__('patients.actions.surgery_appointment'))
|
||||
|
||||
Reference in New Issue
Block a user