How can I search in hidden fields?

Hi I use uuid as id for some tables and I don't display the id in the list. Is there a way to search in this field anyway?
2 Replies
Dan Harrin
Dan Harrin2y ago
you can add it to the searchable() array of a different column
rabol
rabolOP2y ago
ok... will see if I can make it work TextColumn::make('name')->sortable()->searchable( query: function (Builder $query, string $search): Builder { return $query ->where('name', 'like', "%{$search}%") ->orWhere('id', 'like', "%{$search}%"); }), but it does not work aha... wait... i have a global scope... how do I remove that public static function getEloquentQuery(): Builder { return parent::getEloquentQuery()->withoutGlobalScopes(); } all good, thanks
Want results from more Discord servers?
Add your server