EventFollows, thanks. That worked.
I am struggling a bit, because it is a lot more different to Laravel 4 which I have used before.
For example: If I want to query all events I have created now, how can I achieve that?
In the Team Model I created:
public function events()
{
return $this->hasMany(Event::class)->orderBy('created_at', 'asc');
}
The same in the User-Model, because I have a team_id and a user_id in the database for each event.
But how can I get all Events for one team now - the following is not working:
public function all(Request $request)
{
return $request->team()->events;
}
Am I missing something? I think the team is not known to $request?