style: Apply minor formatting adjustments to anonymous function syntax and string concatenations.
This commit is contained in:
parent
32afed7f7b
commit
825c1b210c
@ -24,7 +24,7 @@
|
||||
class CustomMedia extends Page
|
||||
{
|
||||
use HasPageShield;
|
||||
|
||||
|
||||
protected string $view = 'filament.pages.custom-media';
|
||||
|
||||
protected static ?string $title = 'Media';
|
||||
|
||||
@ -42,7 +42,7 @@ public function table(Table $table): Table
|
||||
|
||||
TextColumn::make('e_catalog')
|
||||
->label('E-Catalog')
|
||||
->url(fn($record) => $record->e_catalog)
|
||||
->url(fn ($record) => $record->e_catalog)
|
||||
->openUrlInNewTab()
|
||||
->color('primary'),
|
||||
|
||||
@ -88,7 +88,7 @@ public function table(Table $table): Table
|
||||
->success()
|
||||
->send();
|
||||
})
|
||||
->visible(fn(CooperationProposal $record) => ! auth()->user()->hasRole('Perusahaan') && $record->status === ApprovalStatus::PENDING),
|
||||
->visible(fn (CooperationProposal $record) => ! auth()->user()->hasRole('Perusahaan') && $record->status === ApprovalStatus::PENDING),
|
||||
|
||||
Action::make('reject')
|
||||
->label('Tolak')
|
||||
@ -114,7 +114,7 @@ public function table(Table $table): Table
|
||||
->warning()
|
||||
->send();
|
||||
})
|
||||
->visible(fn(CooperationProposal $record) => ! auth()->user()->hasRole('Perusahaan') && $record->status === ApprovalStatus::PENDING)
|
||||
->visible(fn (CooperationProposal $record) => ! auth()->user()->hasRole('Perusahaan') && $record->status === ApprovalStatus::PENDING)
|
||||
->modalWidth(Width::Large),
|
||||
])
|
||||
->toolbarActions([
|
||||
|
||||
@ -40,7 +40,7 @@ public function form(Schema $schema): Schema
|
||||
|
||||
DatePicker::make('publication_date')
|
||||
->label('Tanggal Publikasi')
|
||||
->placeholder(fn() => now()->format('l, d F Y'))
|
||||
->placeholder(fn () => now()->format('l, d F Y'))
|
||||
->native(false)
|
||||
->displayFormat('l, d F Y')
|
||||
->required(),
|
||||
@ -85,7 +85,7 @@ public function table(Table $table): Table
|
||||
TextColumn::make('link')
|
||||
->label('Link')
|
||||
->limit(30)
|
||||
->url(fn($record) => $record->link)
|
||||
->url(fn ($record) => $record->link)
|
||||
->openUrlInNewTab(),
|
||||
|
||||
TextColumn::make('status')
|
||||
@ -113,7 +113,7 @@ public function table(Table $table): Table
|
||||
->success()
|
||||
->send();
|
||||
})
|
||||
->visible(fn(Report $record) => ! auth()->user()->hasRole('Perusahaan') && $record->status === ApprovalStatus::PENDING),
|
||||
->visible(fn (Report $record) => ! auth()->user()->hasRole('Perusahaan') && $record->status === ApprovalStatus::PENDING),
|
||||
|
||||
Action::make('reject')
|
||||
->label('Tolak')
|
||||
@ -138,7 +138,7 @@ public function table(Table $table): Table
|
||||
->warning()
|
||||
->send();
|
||||
})
|
||||
->visible(fn(Report $record) => ! auth()->user()->hasRole('Perusahaan') && $record->status === ApprovalStatus::PENDING)
|
||||
->visible(fn (Report $record) => ! auth()->user()->hasRole('Perusahaan') && $record->status === ApprovalStatus::PENDING)
|
||||
->modalWidth(Width::Large),
|
||||
])
|
||||
->headerActions([
|
||||
|
||||
@ -93,7 +93,7 @@ public function table(Table $table): Table
|
||||
TextColumn::make('report_count')
|
||||
->label('Laporan Diterima')
|
||||
->getStateUsing(function (TaskAssignment $record) {
|
||||
return $record->reports()->count() . ' / ' . ($record->report_amount * $record->partnerMedia()->count());
|
||||
return $record->reports()->count().' / '.($record->report_amount * $record->partnerMedia()->count());
|
||||
}),
|
||||
])
|
||||
->filters([
|
||||
@ -102,7 +102,7 @@ public function table(Table $table): Table
|
||||
->headerActions([
|
||||
CreateAction::make()
|
||||
->label('Buat Penugasan')
|
||||
->visible(fn() => $this->canCreateTaskAssignment()),
|
||||
->visible(fn () => $this->canCreateTaskAssignment()),
|
||||
])
|
||||
->recordActions([
|
||||
EditAction::make(),
|
||||
|
||||
@ -56,9 +56,9 @@ public static function configure(Table $table): Table
|
||||
->sortable()
|
||||
->date('l, d F Y')
|
||||
->description(
|
||||
fn(Cooperation $record): string => now()->greaterThan($record->final_submission_date)
|
||||
fn (Cooperation $record): string => now()->greaterThan($record->final_submission_date)
|
||||
? 'Waktu Pengajuan Habis'
|
||||
: 'Sisa waktu pengajuan: ' . now()->diffForHumans(
|
||||
: 'Sisa waktu pengajuan: '.now()->diffForHumans(
|
||||
$record->final_submission_date,
|
||||
['syntax' => CarbonInterface::DIFF_ABSOLUTE]
|
||||
)
|
||||
@ -90,9 +90,9 @@ public static function configure(Table $table): Table
|
||||
->html()
|
||||
->getStateUsing(function (Cooperation $record) {
|
||||
$record->loadCount([
|
||||
'partnerMedia as approved_count' => fn($query) => $query->where('status', ApprovalStatus::ACCEPTED),
|
||||
'partnerMedia as rejected_count' => fn($query) => $query->where('status', ApprovalStatus::REJECTED),
|
||||
'partnerMedia as pending_count' => fn($query) => $query->where('status', ApprovalStatus::PENDING),
|
||||
'partnerMedia as approved_count' => fn ($query) => $query->where('status', ApprovalStatus::ACCEPTED),
|
||||
'partnerMedia as rejected_count' => fn ($query) => $query->where('status', ApprovalStatus::REJECTED),
|
||||
'partnerMedia as pending_count' => fn ($query) => $query->where('status', ApprovalStatus::PENDING),
|
||||
]);
|
||||
|
||||
$totalCount = $record->partnerMedia()->count();
|
||||
@ -252,7 +252,7 @@ public static function configure(Table $table): Table
|
||||
->disk(config('filesystems.default'))
|
||||
->acceptedFileTypes(['application/pdf'])
|
||||
->maxSize(1024 * 10)
|
||||
->directory('cooperation/proposal/' . now()->toDateString())
|
||||
->directory('cooperation/proposal/'.now()->toDateString())
|
||||
->required(),
|
||||
])
|
||||
->action(function ($record, array $data) {
|
||||
@ -312,7 +312,7 @@ public static function configure(Table $table): Table
|
||||
->schema([
|
||||
DatePicker::make('start_date')
|
||||
->label('Tanggal Mulai')
|
||||
->placeholder(fn() => now()->translatedFormat('l, d F Y'))
|
||||
->placeholder(fn () => now()->translatedFormat('l, d F Y'))
|
||||
->native(false)
|
||||
->displayFormat('l, d F Y')
|
||||
->locale('id')
|
||||
@ -320,7 +320,7 @@ public static function configure(Table $table): Table
|
||||
|
||||
DatePicker::make('end_date')
|
||||
->label('Tanggal Seleisa')
|
||||
->placeholder(fn() => now()->addDays(30)->translatedFormat('l, d F Y'))
|
||||
->placeholder(fn () => now()->addDays(30)->translatedFormat('l, d F Y'))
|
||||
->native(false)
|
||||
->displayFormat('l, d F Y')
|
||||
->required()
|
||||
@ -365,17 +365,17 @@ public static function configure(Table $table): Table
|
||||
->modalHeading('Buat Penugasan')
|
||||
->modalSubmitActionLabel('Simpan')
|
||||
->visible(
|
||||
fn(Cooperation $record): bool => ! auth()->user()->hasRole('Perusahaan')
|
||||
fn (Cooperation $record): bool => ! auth()->user()->hasRole('Perusahaan')
|
||||
&& ! $record->taskAssignments()->exists()
|
||||
&& $record->status === CooperationStatus::ASSIGNMENT
|
||||
)
|
||||
->modalWidth(Width::Large),
|
||||
|
||||
EditAction::make()
|
||||
->visible(fn() => ! auth()->user()->hasRole('Perusahaan')),
|
||||
->visible(fn () => ! auth()->user()->hasRole('Perusahaan')),
|
||||
|
||||
DeleteAction::make()
|
||||
->visible(fn() => ! auth()->user()->hasRole('Perusahaan')),
|
||||
->visible(fn () => ! auth()->user()->hasRole('Perusahaan')),
|
||||
])
|
||||
->toolbarActions([
|
||||
BulkActionGroup::make([
|
||||
|
||||
@ -104,7 +104,7 @@ public static function form(Schema $schema): Schema
|
||||
->schema(
|
||||
collect($documents)
|
||||
->map(
|
||||
fn($doc) => Section::make($doc['title'])
|
||||
fn ($doc) => Section::make($doc['title'])
|
||||
->schema([
|
||||
TextInput::make($doc['text_name'])
|
||||
->hiddenLabel()
|
||||
|
||||
@ -59,7 +59,7 @@ public static function table(Table $table): Table
|
||||
->label('Perusahaan')
|
||||
->searchable()
|
||||
->sortable()
|
||||
->description(fn(User $record) => $record->company?->director_name),
|
||||
->description(fn (User $record) => $record->company?->director_name),
|
||||
|
||||
TextColumn::make('company.partnerMedia.name')
|
||||
->label('Media')
|
||||
|
||||
@ -473,6 +473,8 @@ public function run(): void
|
||||
"name": "Perusahaan",
|
||||
"guard_name": "web",
|
||||
"permissions": [
|
||||
"View:CustomCompany",
|
||||
"View:CustomMedia",
|
||||
"ViewAny:Cooperation",
|
||||
"View:Cooperation",
|
||||
"Create:Cooperation",
|
||||
|
||||
Loading…
Reference in New Issue
Block a user