Need help with SQL query #11994
-
PackagePanel builder Package Versionv3.0.0 How can we help you?I've tried every combination of getEloquentQuery, applySearchToTableQuery and modifyQueryUsing but getting nowhere. If I hardcode the value of $tableSearch, the table pulls the results from the database almost instantly but typing the value in the tableSearch box (as a user would do), takes ages to pull up the results. Same thing with or without DebugBar. I've tried this in both the resource page and the resource's list page. This is currently in the resource page: public static function table(Table $table): Table Any ideas ? Thanks, Greg |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
You can inject ->modifyQueryUsing(fn (Builder $query, Request $request) => $query->where('title', 'like', '%'.$request->tableSearch.'%')) |
Beta Was this translation helpful? Give feedback.
-
Thanks for the quick response. Using that code I get :
Target class [App\Filament\Resources\Request] does not exist.
…On Sat, Mar 23, 2024 at 8:41 PM Leandro Ferreira ***@***.***> wrote:
You can inject $request
->modifyQueryUsing(fn (Builder $query, Request $request) => $query->where('title', 'like', '%'.$request->tableSearch.'%'))
—
Reply to this email directly, view it on GitHub
<#11994 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ARHP4KWH5DQM5LMMFO6QNETYZVE53AVCNFSM6AAAAABFEB4LF6VHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4DQOBVGYZTI>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
I don't have a solution yet, am trying to make sure I have imported the correct Builder Class, I am trying this one with intermittent results, not fully solved yet: use Illuminate\Contracts\Database\Query\Builder; anyone get this working yet? |
Beta Was this translation helpful? Give feedback.
You can inject
$request