Answers for "laravel eloquent multiple join with where conditions"

PHP
0

laravel eloquent multiple join with where conditions

$users = User::join('posts', 'posts.user_id', '=', 'users.id')
            ->where('users.status', 'active')
            ->where('posts.status','active')
            ->get(['users.*', 'posts.descrption']);
Posted by: Guest on August-08-2021
0

laravel eloquent multiple join

$users = User::join('posts', 'posts.user_id', '=', 'users.id')
              ->join('comments', 'comments.post_id', '=', 'posts.id')
              ->get(['users.*', 'posts.descrption']);
Posted by: Guest on August-08-2021

Code answers related to "laravel eloquent multiple join with where conditions"

Browse Popular Code Answers by Language