style: Standardize arrow function spacing and apply minor formatting adjustments across several Filament resources.
This commit is contained in:
parent
a847b6e1fc
commit
394525bcc2
@ -104,7 +104,7 @@ public static function infolist(Schema $schema): Schema
|
||||
->placeholder('Belum dibalas'),
|
||||
])
|
||||
->columnSpanFull()
|
||||
->visible(fn(Contact $record): bool => $record->replied_at !== null),
|
||||
->visible(fn (Contact $record): bool => $record->replied_at !== null),
|
||||
])
|
||||
->columns(2);
|
||||
}
|
||||
@ -128,7 +128,7 @@ public static function table(Table $table): Table
|
||||
IconColumn::make('replied_at')
|
||||
->label('Dibalas')
|
||||
->boolean()
|
||||
->getStateUsing(fn(Contact $record): bool => $record->replied_at !== null),
|
||||
->getStateUsing(fn (Contact $record): bool => $record->replied_at !== null),
|
||||
|
||||
TextColumn::make('repliedBy.name')
|
||||
->label('Dibalas Oleh')
|
||||
@ -157,7 +157,7 @@ public static function table(Table $table): Table
|
||||
->schema([
|
||||
Textarea::make('reply_message')
|
||||
->label('Pesan Balasan')
|
||||
->placeholder(fn(Contact $record): string => "Halo {$record->name}, ...")
|
||||
->placeholder(fn (Contact $record): string => "Halo {$record->name}, ...")
|
||||
->required()
|
||||
->rows(5)
|
||||
->autocomplete(false)
|
||||
@ -177,7 +177,7 @@ public static function table(Table $table): Table
|
||||
'Pesan balasan Anda sudah meluncur ke email pengirim. Semoga membantu mereka ya! 😊'
|
||||
)->send();
|
||||
})
|
||||
->visible(fn(Contact $record): bool => $record->replied_at === null),
|
||||
->visible(fn (Contact $record): bool => $record->replied_at === null),
|
||||
|
||||
DeleteAction::make()
|
||||
->label('Hapus'),
|
||||
|
||||
@ -37,7 +37,7 @@ protected function getHeaderActions(): array
|
||||
->modalHeading('Tambah Jurnalis')
|
||||
->modalSubmitActionLabel('Simpan')
|
||||
->modalCancelActionLabel('Batal')
|
||||
->extraModalFooterActions(fn(CreateAction $action): array => [
|
||||
->extraModalFooterActions(fn (CreateAction $action): array => [
|
||||
$action->makeModalSubmitAction('createAnother', arguments: ['another' => true])
|
||||
->label('Simpan dan Tambah Lagi'),
|
||||
])
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
class ManageClassifications extends ManageRecords
|
||||
{
|
||||
protected static string $resource = ClassificationResource::class;
|
||||
|
||||
|
||||
protected static ?string $title = 'Klasifikasi';
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
|
||||
@ -21,7 +21,7 @@ protected function getHeaderActions(): array
|
||||
->modalHeading('Tambah OPD')
|
||||
->modalSubmitActionLabel('Simpan')
|
||||
->modalCancelActionLabel('Batal')
|
||||
->extraModalFooterActions(fn(CreateAction $action): array => [
|
||||
->extraModalFooterActions(fn (CreateAction $action): array => [
|
||||
$action->makeModalSubmitAction('createAnother', arguments: ['another' => true])
|
||||
->label('Simpan dan Tambah Lagi'),
|
||||
])
|
||||
|
||||
@ -21,7 +21,7 @@ protected function getHeaderActions(): array
|
||||
->modalHeading('Tambah Lokasi')
|
||||
->modalSubmitActionLabel('Simpan')
|
||||
->modalCancelActionLabel('Batal')
|
||||
->extraModalFooterActions(fn(CreateAction $action): array => [
|
||||
->extraModalFooterActions(fn (CreateAction $action): array => [
|
||||
$action->makeModalSubmitAction('createAnother', arguments: ['another' => true])
|
||||
->label('Simpan dan Tambah Lagi'),
|
||||
])
|
||||
|
||||
@ -21,7 +21,7 @@ protected function getHeaderActions(): array
|
||||
->modalHeading('Tambah Tema')
|
||||
->modalSubmitActionLabel('Simpan')
|
||||
->modalCancelActionLabel('Batal')
|
||||
->extraModalFooterActions(fn(CreateAction $action): array => [
|
||||
->extraModalFooterActions(fn (CreateAction $action): array => [
|
||||
$action->makeModalSubmitAction('createAnother', arguments: ['another' => true])
|
||||
->label('Simpan dan Tambah Lagi'),
|
||||
])
|
||||
|
||||
@ -9,11 +9,12 @@
|
||||
use App\Filament\Actions\Cheerful\ForceDeleteAction;
|
||||
use App\Filament\Actions\Cheerful\RestoreAction;
|
||||
use App\Filament\Actions\DefaultBulkActions;
|
||||
use App\Filament\Support\CheerfulNotification;
|
||||
use App\Filament\Columns\TimestampColumns;
|
||||
use App\Filament\Resources\Master\Users\Pages\ManageUsers;
|
||||
use App\Filament\Support\CheerfulNotification;
|
||||
use App\Models\User;
|
||||
use BackedEnum;
|
||||
use Filament\Actions\Action;
|
||||
use Filament\Actions\BulkActionGroup;
|
||||
use Filament\Forms\Components\Hidden;
|
||||
use Filament\Forms\Components\Select;
|
||||
@ -32,7 +33,6 @@
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
use UnitEnum;
|
||||
use Filament\Actions\Action;
|
||||
|
||||
class UserResource extends Resource
|
||||
{
|
||||
@ -90,7 +90,7 @@ public static function form(Schema $schema): Schema
|
||||
->searchable(),
|
||||
|
||||
Hidden::make('password')
|
||||
->default(fn(?User $record): ?string => $record ? null : config('auth.password_default')),
|
||||
->default(fn (?User $record): ?string => $record ? null : config('auth.password_default')),
|
||||
])
|
||||
->columns(1);
|
||||
}
|
||||
@ -117,7 +117,7 @@ public static function table(Table $table): Table
|
||||
ToggleColumn::make('is_active')
|
||||
->label('Status')
|
||||
->sortable()
|
||||
->getStateUsing(fn(User $record): bool => $record->is_active === IsActive::ACTIVE)
|
||||
->getStateUsing(fn (User $record): bool => $record->is_active === IsActive::ACTIVE)
|
||||
->updateStateUsing(function (User $record, bool $state): void {
|
||||
$record->is_active = $state ? IsActive::ACTIVE : IsActive::INACTIVE;
|
||||
$record->save();
|
||||
@ -134,35 +134,35 @@ public static function table(Table $table): Table
|
||||
->success()
|
||||
->send();
|
||||
})
|
||||
->disabled(fn(User $record): bool => $record->hasRole(RoleEnum::PERUSAHAAN->value)),
|
||||
->disabled(fn (User $record): bool => $record->hasRole(RoleEnum::PERUSAHAAN->value)),
|
||||
|
||||
TextColumn::make('roles.name')
|
||||
->label('Peran')
|
||||
->searchable()
|
||||
->sortable()
|
||||
->badge()
|
||||
->getStateUsing(fn(User $record): array => $record->roles->pluck('name', 'id')->toArray()),
|
||||
->getStateUsing(fn (User $record): array => $record->roles->pluck('name', 'id')->toArray()),
|
||||
|
||||
...TimestampColumns::make(),
|
||||
])
|
||||
->filters([
|
||||
TrashedFilter::make()
|
||||
->native(false)
|
||||
->visible(fn() => auth()->user()?->hasRole('Developer')),
|
||||
->visible(fn () => auth()->user()?->hasRole('Developer')),
|
||||
])
|
||||
->recordActions([
|
||||
EditAction::make()
|
||||
->modalWidth(Width::Large)
|
||||
->hidden(fn(User $record): bool => $record->hasRole(RoleEnum::PERUSAHAAN->value)),
|
||||
->hidden(fn (User $record): bool => $record->hasRole(RoleEnum::PERUSAHAAN->value)),
|
||||
|
||||
DeleteAction::make()
|
||||
->hidden(fn(User $record): bool => $record->hasRole(RoleEnum::PERUSAHAAN->value)),
|
||||
->hidden(fn (User $record): bool => $record->hasRole(RoleEnum::PERUSAHAAN->value)),
|
||||
|
||||
ForceDeleteAction::make()
|
||||
->hidden(fn(User $record): bool => $record->hasRole(RoleEnum::PERUSAHAAN->value)),
|
||||
->hidden(fn (User $record): bool => $record->hasRole(RoleEnum::PERUSAHAAN->value)),
|
||||
|
||||
RestoreAction::make()
|
||||
->hidden(fn(User $record): bool => $record->hasRole(RoleEnum::PERUSAHAAN->value)),
|
||||
->hidden(fn (User $record): bool => $record->hasRole(RoleEnum::PERUSAHAAN->value)),
|
||||
|
||||
Action::make('resetPassword')
|
||||
->label('Ganti Kata Sandi')
|
||||
@ -187,7 +187,7 @@ public static function table(Table $table): Table
|
||||
"Kata sandi untuk pengguna {$record->name} telah diperbarui."
|
||||
)->send();
|
||||
})
|
||||
->hidden(fn(User $record): bool => $record->hasRole(RoleEnum::PERUSAHAAN->value)),
|
||||
->hidden(fn (User $record): bool => $record->hasRole(RoleEnum::PERUSAHAAN->value)),
|
||||
])
|
||||
->toolbarActions([
|
||||
BulkActionGroup::make([
|
||||
|
||||
@ -75,16 +75,16 @@ public static function form(Schema $schema): Schema
|
||||
|
||||
CheckboxList::make('partnerMedia')
|
||||
->label('Kirim Kepada')
|
||||
->relationship('partnerMedia', 'name', fn(Builder $query): Builder => $query->verified())
|
||||
->visible(fn(Get $get): bool => in_array($get('type'), [AnnouncementType::COMPANY, AnnouncementType::COMPANY->value]))
|
||||
->required(fn(Get $get): bool => in_array($get('type'), [AnnouncementType::COMPANY, AnnouncementType::COMPANY->value]))
|
||||
->relationship('partnerMedia', 'name', fn (Builder $query): Builder => $query->verified())
|
||||
->visible(fn (Get $get): bool => in_array($get('type'), [AnnouncementType::COMPANY, AnnouncementType::COMPANY->value]))
|
||||
->required(fn (Get $get): bool => in_array($get('type'), [AnnouncementType::COMPANY, AnnouncementType::COMPANY->value]))
|
||||
->searchable()
|
||||
->noSearchResultsMessage('Tidak ada media yang ditemukan.')
|
||||
->helperText('Pilih media yang akan menerima pengumuman ini')
|
||||
->columnSpanFull()
|
||||
->bulkToggleable()
|
||||
->selectAllAction(
|
||||
fn(Action $action): Action => $action->label('Pilih Semua Media'),
|
||||
fn (Action $action): Action => $action->label('Pilih Semua Media'),
|
||||
)
|
||||
->dehydrated(),
|
||||
|
||||
@ -121,7 +121,7 @@ public static function table(Table $table): Table
|
||||
->listWithLineBreaks()
|
||||
->limitList(3)
|
||||
->expandableLimitedList()
|
||||
->placeholder(fn(Announcement $record): string => $record->type === AnnouncementType::PUBLIC ? 'Publik' : 'Tidak ada penerima'),
|
||||
->placeholder(fn (Announcement $record): string => $record->type === AnnouncementType::PUBLIC ? 'Publik' : 'Tidak ada penerima'),
|
||||
|
||||
...TimestampColumns::make(),
|
||||
])
|
||||
@ -131,7 +131,7 @@ public static function table(Table $table): Table
|
||||
->recordActions([
|
||||
EditAction::make()
|
||||
->modalWidth(Width::TwoExtraLarge)
|
||||
->visible(fn(Announcement $record): bool => $record->type === AnnouncementType::PUBLIC),
|
||||
->visible(fn (Announcement $record): bool => $record->type === AnnouncementType::PUBLIC),
|
||||
|
||||
DeleteAction::make(),
|
||||
|
||||
|
||||
@ -26,7 +26,7 @@ protected function getHeaderActions(): array
|
||||
->modalHeading('Tambah Pengumuman')
|
||||
->modalSubmitActionLabel('Simpan')
|
||||
->modalCancelActionLabel('Batal')
|
||||
->extraModalFooterActions(fn(CreateAction $action): array => [
|
||||
->extraModalFooterActions(fn (CreateAction $action): array => [
|
||||
$action->makeModalSubmitAction('createAnother', arguments: ['another' => true])
|
||||
->label('Simpan dan Tambah Lagi'),
|
||||
])
|
||||
|
||||
Loading…
Reference in New Issue
Block a user