Kasio Eduardo
Kasio Eduardo

Reputation: 21

How to create automatic routine on laravel

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

Answers (1)

Jonathas Nascimento
Jonathas Nascimento

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

Related Questions