Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

deepu07's avatar
Level 11

Events vs Observers

I'm really confused with events and observers. because both are doing same things. what are the differences b/w events and observers? Thanks in advance.

0 likes
6 replies
Cronix's avatar

Observers are basically predefined events that happen only on Eloquent Models (creating a record, updating a record, deleting, etc). Events are generic, aren't predefined, and can be used anywhere, not just in models.

1 like
cmdobueno's avatar
Level 18

Observers and events do not do the same thing at all.

An observer watches for specific things that happen within eloquent such as saving, saved, deleting, deleted (there are more but you should get the point). Observers are specifically bound to a model.

Events:

Events are actions that are driven by whatever the programmer wants. If you want to fire an event when somebody loads a page, you can do that. Unlike observers events can also be queue, and ran via laravels cron heartbeat. Events are programmer defined effectively. They give you the ability to handle actions that you would not want a user to wait for (excxample being the purchase of a pod cast)

The documentation does a very good job covering these.

10 likes
cmdobueno's avatar

@deepu07

Not really the same kind of jobs. Generally speaking an observer has the ability to interact with the record from the database (but you can call an event)

truejoy's avatar

An Observer is a design pattern basically and it holds almost same concept in laravel too. An observer listens for one or multiple events and do something based on that. So, basically an observer listens for an event to occur.

Please or to participate in this conversation.