Reputation: 21
my english is bad, I'm going to try to be as fast as possible.
I have an "events" model and it has several attributes, but more important would be date and status (active or inactive).
How to create a logic for laravel that when passing the event date its status is changed.
Upvotes: 0
Views: 272
Reputation: 290
If you use Eloquent, you needs updates your Event model like that
Events::where('date', $my_date)
->update(['status' => $my_active_status]);
To more details about Laravel Eloquent see https://laravel.com/docs/5.8/eloquent
Upvotes: 1