N
N
NubasLol2019-02-13 20:40:35
Layout
NubasLol, 2019-02-13 20:40:35

Laravel exists in sub select, or how to get sql with substituted parameters?

$sql = Post::where('user_id',  $user->id)->toSql();

$query->addSubSelect('exists_post', "select exists($sql)");

How can one change such a query so as not to do toSql(). And if this cannot be avoided, how to get sql with parameters?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
N
Nikita Shchypylov, 2016-08-11
@Nikulio

If you want to make it right, then you need:
1) Make it right
2) Done!

Y
Yakov Vylegzhanin, 2016-08-11
@vylegzhanin

Style checkboxes with CSS.
Expand lists with jQueryslideToggle()

V
Vitaly Yushkevich, 2019-02-15
@NubasLol

If you understand the question correctly, then look here https://laravel.com/docs/5.7/queries#where-exists-...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question