|null */ public ?array $data = []; public function mount(): void { $this->form->fill(Profile::query()->first()?->toArray() ?? []); } public function defaultForm(Schema $schema): Schema { return $schema->statePath('data'); } public function form(Schema $schema): Schema { return $schema ->components([ TextInput::make('name') ->required(), TextInput::make('headline') ->helperText('A short tagline shown under your name, e.g. "Backend developer & tinkerer".'), RichEditor::make('bio') ->columnSpanFull(), TextInput::make('location'), TextInput::make('email') ->email(), FileUpload::make('avatar') ->image() ->disk('public') ->directory('profile'), FileUpload::make('resume_path') ->label('Resume / CV') ->disk('public') ->directory('profile'), KeyValue::make('social_links') ->keyLabel('Platform') ->valueLabel('URL') ->columnSpanFull(), ]); } public function save(): void { $data = $this->form->getState(); Profile::query()->first()?->update($data) ?? Profile::create($data); Notification::make() ->title('Profile saved') ->success() ->send(); } }