prgrm
prgrm

Reputation: 3835

How to fire an event when something in the Database changes in Laravel?

I have an external script that changes some tables in a database.

I want to fire some scripts whenever this happens.

I could do this with a PHP/Perl daemon easily, however I wonder if Laravel has something for this.

Upvotes: 0

Views: 633

Answers (1)

Elie Faës
Elie Faës

Reputation: 3315

Don't know if it's relevant for what you're trying to do but you can use the Laravel Scheduler to run a command that checks (every minutes or more) if the database changed.

If you can too, fire a command directly from your external script like

php path/to/artisan your:command-name

Upvotes: 1

Related Questions