I have three tables that are the following users , maps , bookmarks
- A user has several maps
- a map has several markers
What I am trying to do is show the markers that belong to the maps of the user who has logged in.
This is the function in the controller that I am working on:
public function index()
{
$mapas = Mapa::orderBy('id', 'DESC')->where('user_id', auth()->user()->id);
$marcadores = Marcador::orderBy('id', 'DESC')->where('mapa_id');
return view('user.marcadores.index', compact('marcadores'));
}