I was discussing Laravel's event system with another developer today. He mentioned that Laravel's event dispatcher uses an observer pattern.
I always thought it implemented a mediator pattern as your objects always listen/fire events through an event dispatcher object, but the doc says it is an observer.
Event::listen('event.name', function ($foo, $bar) {
//
});
Event::fire("event.name", []);
Isn't this a mediator pattern?
I have no precise idea about what Laravel's concretely do and actually if the doc says that it is built on an observer pattern, I would believe it.
However your question is about what the code looks like and from my experience I can easily recognize an observer here with the analogy :
A mediator would seem weird to me here because even though the intent is to facilitate the communication between some objects, I can't see it as a good way to distribute notifications. I would definitely bet on an observer for that reason.