label('Kembali') ->url(ListCooperations::getUrl()) ->outlined() ->color('secondary'), ]; } protected function getRedirectUrl(): string { return $this->getResource()::getUrl('index'); } protected function afterCreate(): void { $record = $this->getRecord(); $data = $this->data; if (empty($data['proposal_template'])) { return; } $filePath = collect($data['proposal_template'])->first(); $fullPath = Storage::disk(config('filesystems.default'))->path($filePath); if (! file_exists($fullPath)) { return; } $record ->addMediaFromDisk($filePath, config('filesystems.default')) ->preservingOriginal() ->withCustomProperties([ 'feature' => 'cooperations', 'date' => now()->toDateString(), 'doc_type' => 'proposal-template', ]) ->toMediaCollection('cooperations'); } }