I have 3 models
Event - table('events')
Shift - table('shifts')
Workedtime - table('workedtimes')
and I can call event->shifts->workedtimes, all is fine there.
And now I want to make a query to get all Events where (Auth) user has worked.
Something like this:
Event::with('workedtimes')->where('workedtimes.uid', Auth::user()->id)->get();
But this doesn't work. What can I try next?