I am trying to compare the two values from two tables and output the results if the values match.
$id = Auth::user()->id;
$user_id = DB::table('orders')->select('user_id')->get();
if ($id == $user_id)
{
$data = Order::All();
}
else
{
return view('dashboard');
}
return view('profile.list',compact('data'));
But I am getting this error
ErrorException Object of class Illuminate\Support\Collection could not be converted to int