Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

laravel eloquent query with orderBy subquery

select('forum_posts.*')->orderByRaw('...')
// or 
Post::query()->select('forum_posts.*')->orderByDesc(
    Post::where() ...
)
// or 
Post::query()->select('forum_posts.*')->orderBy(DB::raw('...'));
 
PREVIOUS NEXT
Tagged: #laravel #eloquent #query #orderBy #subquery
ADD COMMENT
Topic
Name
2+5 =