Support the ongoing development of →
Eloquent Laravel
Last updated 8 months ago.

You don't have to save the model object inside the model event handler, it will eventually be saved, so this is enough:

protected static function boot()
        static::saving(function ($model){
            if ($model->Qty <= 0)
                $model->Status ='Not Available';
            if ($model->Qty <= 5 && $model->Qty >= 1)
                $model->Status ='Reorder level';

Pls update and try again.


Sign in to participate in this thread!

Full Stack Europe

Your banner here too?


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

Your logo here?

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

© 2023 - All rights reserved.