Ad

Laravel Join(): Argument Must Be An Array

- 1 answer

I'm trying to read 2 tables in my view. Now I am trying to join an other table like this in my sslcontroller.php

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\DB;

class sslController extends Controller
{
    function SSL(){
        $data = DB::table('SSL')->where('userID', Auth::id())->get();
        join('users');
        return view('SSL',['data'=>$data]);
    }
}

Now I want to get data from the SSL table but also from the users table. How to do this?

Ad

Answer

this should work for you:

$data = DB::table('SSL')->where('userID', Auth::id())
->join('users', 'users.id', '=', 'SSL.userID');
->get();
Ad
source: stackoverflow.com
Ad