samedi 19 octobre 2019

Is there a way to test Eloquent Observers in Laravel 5.8?

This is the problem I'm having: My code is set in a way that whenever Model's X title gets updated, it should change Model Y's count.

So what I do is, i send request that will trigger the event described above, BUT whenever i check if the changes are made in the database, they are not.

I've tried dd() inside the X Observers updated function, and it gets properly fired.

Any ideas?

Edit: I'm testing with assertDatabaseHas()

Aucun commentaire:

Enregistrer un commentaire