form input default value not passed

Here is my code
Select::make('site')
->relationship(name: 'site', titleAttribute: 'name')
->default(Auth::user()->person->site_id)
->createOptionForm([
Forms\Components\TextInput::make('name')
->required(),
]),
Select displays correctly as expected but when press create get error as no data passed from this select. By default I want the select to be the logged in users site. Which it does display but goes blank when press create
Solution
Don't use relationship() if you dont' want to save it to a relationship
Was this page helpful?