Did you try toSql
or toRawSql()
? With toSql you should get the query where the bindings aren't filled. But with toRawSql they are filled.
See this basic example:
php artisan tinker
Psy Shell v0.11.21 (PHP 8.2.15 — cli) by Justin Hileman
> $query = User::query()->where('id', 1);
[!] Aliasing 'User' to 'App\Models\User' for this Tinker session.
= Illuminate\Database\Eloquent\Builder {#6979}
> $query->toSql();
= "select * from `users` where `id` = ?"
> $query->toRawSql();
= "select * from `users` where `id` = 1"
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community