feat: add labels to form fields and configure global validation attribute mapping to field labels
This commit is contained in:
parent
075ba0d279
commit
d7d53c0e8b
@ -69,6 +69,7 @@ public static function configure(Schema $schema): Schema
|
||||
Section::make('NIk Direktur')
|
||||
->schema([
|
||||
TextInput::make('director_nik')
|
||||
->label('NIK Direktur')
|
||||
->hiddenLabel()
|
||||
->placeholder('32***')
|
||||
->autocomplete(false)
|
||||
@ -79,6 +80,7 @@ public static function configure(Schema $schema): Schema
|
||||
->regex('/^[0-9]+$/'),
|
||||
|
||||
AdvancedFileUpload::make('director_nik_docs')
|
||||
->label('Dokumen NIK Direktur')
|
||||
->hiddenLabel()
|
||||
->disk(config('filesystems.default'))
|
||||
->acceptedFileTypes(['image/*'])
|
||||
@ -94,6 +96,7 @@ public static function configure(Schema $schema): Schema
|
||||
return Section::make(fn () => $doc['title'])
|
||||
->schema([
|
||||
TextInput::make($doc['text_name'])
|
||||
->label($doc['title'])
|
||||
->hiddenLabel()
|
||||
->placeholder($doc['placeholder'])
|
||||
->autocomplete(false)
|
||||
@ -101,6 +104,7 @@ public static function configure(Schema $schema): Schema
|
||||
->maxLength($doc['max']),
|
||||
|
||||
AdvancedFileUpload::make($doc['file_name'])
|
||||
->label('Dokumen '.$doc['title'])
|
||||
->hiddenLabel()
|
||||
->disk(config('filesystems.default'))
|
||||
->acceptedFileTypes($doc['accept'])
|
||||
|
||||
@ -73,6 +73,7 @@ public static function configure(Schema $schema): Schema
|
||||
return Section::make(fn () => $doc['title'])
|
||||
->schema([
|
||||
TextInput::make($doc['text_name'])
|
||||
->label($doc['title'])
|
||||
->hiddenLabel()
|
||||
->placeholder($doc['placeholder'])
|
||||
->autocomplete(false)
|
||||
@ -80,6 +81,7 @@ public static function configure(Schema $schema): Schema
|
||||
->maxLength($doc['max']),
|
||||
|
||||
AdvancedFileUpload::make($doc['file_name'])
|
||||
->label('Dokumen '.$doc['title'])
|
||||
->hiddenLabel()
|
||||
->disk(config('filesystems.default'))
|
||||
->acceptedFileTypes($doc['accept'])
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use Filament\Forms\Components\Field;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\URL;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
@ -59,5 +60,9 @@ public function boot(): void
|
||||
if (! app()->environment('local')) {
|
||||
URL::forceScheme('https');
|
||||
}
|
||||
|
||||
Field::configureUsing(function (Field $field): void {
|
||||
$field->validationAttribute(fn (Field $component) => $component->getLabel());
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user