join in inner function laravel code example
Example 1: join in laravel
$subCategories = Subcategory::join('categories', 'subcategories.category_id', '=', 'categories.id')
->select('subcategories.*', 'categories.name AS cname')
->orderBy('id', 'desc')
->get();
Example 2: laravel outer join
->join('answers as answers', 'responses.answer_id', '=', 'answers.id', 'left outer')