Select relationship

hello on my case my relation between User and Company is one to many "company HasMany users" on my code i can gate companies without users on the creation but when i edit i want also add on my select the company of the user
this is my current code :
Select::make('company_id')
->relationship('company', 'name',fn (Builder $query)
=> $query
->whereDoesntHave('users' )
)
Company_Model.png
user_Model.png
Was this page helpful?