Hello Please I am trying to view the records of a user based on the user id I used as a foreign key in another table in laravel. Basically I want the name of the userID to show.
This is my Controller
public function index()
{
$id = User::all();
$organisedTrips = organisedTrip::where('userID', '=', $id)->get();
$organisedTrips = organisedTrip::paginate(4);
return view('welcome', compact('organisedTrips'));
}