Select mofiyQueryUsing return only Id on relationship
Dear all, according code under, is modified query but returned to options ID, not name ..., and is possible to show searchable only if option is more than 6 ?
Select::make('safirsBranch_id')
->label(('app.safirs.safirsBranch'))
->relationship('safirsBranch', 'safirsBranchName',
fn (Builder $query) => $query->where('id', auth()->user()->safirsBranches->pluck('id')->toArray()))
->required()
->native(false)
//->searchable() if count of options is more than 6
->searchable()
->preload()
->placeholder(('app.safirs.safirsBranch')),
2 Replies