defaultHeader = $header; return $this; } public function defaultSubheader(string | Closure $subheader): static { $this->defaultSubheader = $subheader; return $this; } protected function setUp(): void { parent::setUp(); $this->collapsible(); $this->collapsed(); $company = Auth::user()->currentCompany; $this->schema([ Split::make([ Group::make([ FileUpload::make('logo') ->openable() ->maxSize(1024) ->localizeLabel() ->visibility('public') ->disk('public') ->directory('logos/document') ->imageResizeMode('contain') ->imageCropAspectRatio('3:2') ->panelAspectRatio('3:2') ->maxWidth(MaxWidth::ExtraSmall) ->panelLayout('integrated') ->removeUploadedFileButtonPosition('center bottom') ->uploadButtonPosition('center bottom') ->uploadProgressIndicatorPosition('center bottom') ->getUploadedFileNameForStorageUsing( static fn (TemporaryUploadedFile $file): string => (string) str($file->getClientOriginalName()) ->prepend(Auth::user()->currentCompany->id . '_'), ) ->acceptedFileTypes(['image/png', 'image/jpeg', 'image/gif']), ]), Group::make([ TextInput::make('header') ->default(fn () => $this->getDefaultHeader()), TextInput::make('subheader') ->default(fn () => $this->getDefaultSubheader()), View::make('filament.forms.components.company-info') ->viewData([ 'company_name' => $company->name, 'company_address' => $company->profile->address, 'company_city' => $company->profile->city?->name, 'company_state' => $company->profile->state?->name, 'company_zip' => $company->profile->zip_code, 'company_country' => $company->profile->state?->country->name, ]), ])->grow(true), ])->from('md'), ]); } public function getDefaultHeader(): ?string { return $this->evaluate($this->defaultHeader); } public function getDefaultSubheader(): ?string { return $this->evaluate($this->defaultSubheader); } }