Nested arrays may not be passed to whereIn method.

Using the Forms package i'm creating an edit field for a user. They can update their skills using a multiple select. But when loading the page im hit with "Nested Arrays may not be passed to whereIn method" my component:
public User $user;
public array $data;

public function mount(): void
{
$this->user = auth()->user();
$this->form->fill($this->user->toArray());
}

public function form(Form $form): Form
{
return $form
->schema([
Select::make('skills')
->relationship('skills', 'title')
->searchable()
->label(__('Skills'))
->multiple()
])
->statePath('data')
->model($this->user);
}
public User $user;
public array $data;

public function mount(): void
{
$this->user = auth()->user();
$this->form->fill($this->user->toArray());
}

public function form(Form $form): Form
{
return $form
->schema([
Select::make('skills')
->relationship('skills', 'title')
->searchable()
->label(__('Skills'))
->multiple()
])
->statePath('data')
->model($this->user);
}
3 Replies
toeknee
toeknee8mo ago
What is the skills relationshio?
N16htSh1ft
N16htSh1ft8mo ago
Hello, Can you pass an example with the following log info? Log::info('User data loaded:', $this->user->toArray()); Log::debug('Form data state:', ['data' => $this->data]); Log::debug('Form schema prepared:', ['schema' => $form->getSchema()]); Greetings N16htSh1ft
RMK147
RMK1472mo ago
did you solve this issue? im having the same problem now, apparently its to do with eager loading the relationship according to this post ive found, but not had chance to test it out yet: https://laracasts.com/discuss/channels/filament/help-nested-arrays-may-not-be-passed-to-wherein-method
Laracasts
Want results from more Discord servers?
Add your server