select not saving the right value

Ello! right now he is saving the id of the category but it needs to save the category and then the name,
Select::make('categories')
                ->multiple()
                ->options(fn (): array => Category::pluck('name')->toArray())
                ->getSearchResultsUsing(fn (string $search): array => Category::where('name', 'like', "%{$search}%")->limit(50)->pluck('name', 'id')->toArray()),
Solution
That's because you just plucked the name and not the id. It doesn't even have an ID.
Was this page helpful?