What is the difference between these two options on a select filter?

I've seen this done both ways but unsure which to use?

SelectFilter::make('tags')
    ->options(
        fn (): array => Tag::getWithType('crm.accounts')->pluck('name', 'name')->all()
    )


vs

SelectFilter::make('tags')
    ->options(Tag::getWithType('crm.accounts')->pluck('name', 'name'))
Solution
🤷‍♂️ nothing

you dont need ->all() at all

all if you have some operations on the collection like filtering or additions etc
Was this page helpful?