Skip to content
Advertisement

Creating a subquery using laravel eloquent

My raw query is working fine but after converting it to Laravel eloquent it’s not working.

JavaScript

Advertisement

Answer

You can do the sub query and pass the result to the outer query:

JavaScript

The inner query Ttl::select('ttl') should return a single cell value though, I just tried to do it as you mentioned in your example

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement