Skip to content

Commit eed6921

Browse files
author
Hatim EL OUFIR
committed
Design enhancement: companies dialog
1 parent 17658aa commit eed6921

1 file changed

Lines changed: 32 additions & 20 deletions

File tree

app/Http/Livewire/Administration/CompaniesDialog.php

Lines changed: 32 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -56,36 +56,48 @@ public function render()
5656
protected function getFormSchema(): array
5757
{
5858
return [
59-
Grid::make()
59+
60+
Grid::make(5)
6061
->schema([
61-
FileUpload::make('logo')
62-
->image()
63-
->maxSize(10240)
64-
->label(__('Logo')),
65-
]),
6662

67-
TextInput::make('name')
68-
->label(__('Company name'))
69-
->maxLength(255)
70-
->unique(table: Company::class, column: 'name', ignorable: fn () => $this->company, callback: function (Unique $rule) {
71-
return $rule->withoutTrashed();
72-
})
73-
->required(),
63+
Grid::make(1)
64+
->columnSpan(2)
65+
->schema([
66+
FileUpload::make('logo')
67+
->image()
68+
->maxSize(10240)
69+
->label(__('Logo')),
70+
]),
71+
72+
Grid::make(1)
73+
->columnSpan(3)
74+
->schema([
75+
76+
TextInput::make('name')
77+
->label(__('Company name'))
78+
->maxLength(255)
79+
->unique(table: Company::class, column: 'name', ignorable: fn () => $this->company, callback: function (Unique $rule) {
80+
return $rule->withoutTrashed();
81+
})
82+
->required(),
83+
84+
Select::make('responsible_id')
85+
->label(__('Responsible'))
86+
->searchable()
87+
->required()
88+
->options(User::all()->pluck('name', 'id')->toArray()),
89+
]),
90+
91+
]),
7492

7593
RichEditor::make('description')
7694
->label(__('Description'))
7795
->fileAttachmentsDisk(config('filesystems.default'))
7896
->fileAttachmentsDirectory('companies')
7997
->fileAttachmentsVisibility('private'),
8098

81-
Select::make('responsible_id')
82-
->label(__('Responsible'))
83-
->searchable()
84-
->required()
85-
->options(User::all()->pluck('name', 'id')->toArray()),
86-
8799
Toggle::make('is_disabled')
88-
->label(__('Disable access to this company'))
100+
->label(__('Disable access to this company')),
89101
];
90102
}
91103

0 commit comments

Comments
 (0)