FilamentF
Filament15mo ago
Stricks

Trouble with Attach (Detach works)

I'm new to Filament, so this may be obvious, but I've got a simple many-to-many relationship set up and working. It's a "Family" that can have one or more "Person", and a "Person" can belong to more than one "Family". Pardon the funky plurals here. I'm still trying to figure out how Laravel likes these to be done.

My issue is that when I go to Attach a record to a Person who belongs to a Family, the Attach box comes up, but the pulldown is blank. However, the Search window can be typed in, and it pulls up real data. I can pick from the data (People) and attach the record. See enclosed pic. The tables are tiny (about 50 rows of fake data.

So all of this kinda works, but there are two issues:
  1. The pulldown doesn't populate, so I'm forced to use search.
  2. The Search only shows the first_name field and I'd like it to show the last_name field as well.
I've googled and googled and exhausted myself on ChatGPT, but I can't find a simple explanation of "put this code in these files, and it will work". So many examples show code, but don't reference exactly what file to put it in. The Laracast course goes very fast and barely touches on this topic.

Can anyone point me to a newbie HowTo on this subject? I'm soooo close to getting this working, but the solution is elusive.
Cursor_and_Edit_Family_-_Laravel.png
Was this page helpful?