Answers for "laravel db inner join"

PHP
4

Laravel 8 query builder, Inner Join Clause

use Illuminate\Support\Facades\DB;

$users = DB::table('users')
            ->join('contacts', 'users.id', '=', 'contacts.user_id')
            ->join('orders', 'users.id', '=', 'orders.user_id')
            ->select('users.*', 'contacts.phone', 'orders.price')
            ->get();
Posted by: Guest on December-09-2020
1

laravel outer join

->join('answers as answers', 'responses.answer_id', '=', 'answers.id', 'left outer')
Posted by: Guest on June-05-2020

Browse Popular Code Answers by Language