I need to find the minimum "priority" value and then set it's value to another entry, in place using laravel eloquent.
Is there any way to do so or any best practice for it?
What I have in mind :
Orders::where('user_id', '!=', $user_id)
->where('odm_id', $odm_id)
->whereExpired(0)
->min('priority')
->update(['priority' => 1]);
FYI: Above approach is giving an error and is not working.
The Error Message is :
Call to a member function update() on string