feat: Add phone number field to companies table, migration, and Filament forms/resources.
This commit is contained in:
parent
779154f972
commit
dfef159634
@ -62,6 +62,7 @@ public function handle()
|
|||||||
'user_id' => $user->id,
|
'user_id' => $user->id,
|
||||||
'name' => $legacy->name,
|
'name' => $legacy->name,
|
||||||
'email' => $legacy->email,
|
'email' => $legacy->email,
|
||||||
|
'phone_number' => $legacy->phone_number,
|
||||||
'address' => $legacy->address,
|
'address' => $legacy->address,
|
||||||
'director_name' => $legacy->director,
|
'director_name' => $legacy->director,
|
||||||
'director_nik' => $legacy->nick_director,
|
'director_nik' => $legacy->nick_director,
|
||||||
|
|||||||
@ -193,6 +193,13 @@ public static function form(Schema $schema): Schema
|
|||||||
->required()
|
->required()
|
||||||
->maxLength(100),
|
->maxLength(100),
|
||||||
|
|
||||||
|
TextInput::make('director_name')
|
||||||
|
->label('Nama Direktur')
|
||||||
|
->placeholder('John Doe')
|
||||||
|
->autocomplete(false)
|
||||||
|
->required()
|
||||||
|
->maxLength(150),
|
||||||
|
|
||||||
TextInput::make('email')
|
TextInput::make('email')
|
||||||
->label('Alamat Surel')
|
->label('Alamat Surel')
|
||||||
->placeholder('johndoe@example.com')
|
->placeholder('johndoe@example.com')
|
||||||
@ -200,20 +207,19 @@ public static function form(Schema $schema): Schema
|
|||||||
->required()
|
->required()
|
||||||
->maxLength(254),
|
->maxLength(254),
|
||||||
|
|
||||||
|
TextInput::make('phone_number')
|
||||||
|
->label('Nomor Telepon')
|
||||||
|
->placeholder('08xx xxxx xxxx')
|
||||||
|
->autocomplete(false)
|
||||||
|
->maxLength(20)
|
||||||
|
->tel(),
|
||||||
|
|
||||||
Textarea::make('address')
|
Textarea::make('address')
|
||||||
->label('Alamat')
|
->label('Alamat')
|
||||||
->placeholder('Jl. Kebontoro, Jakarta Pusat')
|
->placeholder('Jl. Kebontoro, Jakarta Pusat')
|
||||||
->autocomplete(false)
|
->autocomplete(false)
|
||||||
->required()
|
->required()
|
||||||
->columnSpanFull(),
|
->columnSpanFull(),
|
||||||
|
|
||||||
TextInput::make('director_name')
|
|
||||||
->label('Nama Direktur')
|
|
||||||
->placeholder('John Doe')
|
|
||||||
->autocomplete(false)
|
|
||||||
->required()
|
|
||||||
->maxLength(150)
|
|
||||||
->columnSpanFull(),
|
|
||||||
])
|
])
|
||||||
->columns(2)
|
->columns(2)
|
||||||
->columnSpan(2),
|
->columnSpan(2),
|
||||||
|
|||||||
@ -80,6 +80,9 @@ public static function infolist(Schema $schema): Schema
|
|||||||
TextEntry::make('company.email')
|
TextEntry::make('company.email')
|
||||||
->label('Email'),
|
->label('Email'),
|
||||||
|
|
||||||
|
TextEntry::make('company.phone_number')
|
||||||
|
->label('Nomor Telepon'),
|
||||||
|
|
||||||
TextEntry::make('company.address')
|
TextEntry::make('company.address')
|
||||||
->label('Alamat'),
|
->label('Alamat'),
|
||||||
|
|
||||||
|
|||||||
@ -16,6 +16,7 @@ public function up(): void
|
|||||||
$table->foreignId('user_id')->constrained()->cascadeOnDelete();
|
$table->foreignId('user_id')->constrained()->cascadeOnDelete();
|
||||||
$table->string('name', 100)->index();
|
$table->string('name', 100)->index();
|
||||||
$table->string('email', 254)->index();
|
$table->string('email', 254)->index();
|
||||||
|
$table->string('phone_number', 20)->nullable();
|
||||||
$table->text('address');
|
$table->text('address');
|
||||||
$table->string('director_name', 150);
|
$table->string('director_name', 150);
|
||||||
$table->string('director_nik', 16);
|
$table->string('director_nik', 16);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user