I have 3 models: User
, Company
and Vacancie
.
The Models have the following relations:
User many to many
Company
Company one to many
Vacancie
How can I get all Vacancie
a User
has access to?
I've found this answer but auth()->user()->with('companies.vacancies')->get();
returns all users of my database.