Support the ongoing development of Laravel.io →
Database Eloquent

This tables are just for example.

Let's say we have two tables: order_items(id int, name string, printed int ) - output(id int, order_item_id, quantity int)

So when printed is changed from 0 to 1, we add a record to output with that order_item. But when we update printed to 0, we delete that record to previous state. I'm trying to make simple event listener or something on specific attribute, can it be done?

Last updated 3 years ago.
0

Sign in to participate in this thread!

PHPverse

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.