user3038607
user3038607

Reputation: 411

Laravel - How to call a method once a day automatically

I am using Laravel v. 4.1 on a website. Every once in a month, I need a specific method to be called automatically for a monthly payment with Moneris. I already tested my API and it's working pretty fine. But how to call this method once a day to check if users have to pay for their monthly payment? Is it possible to do that and to call it without having a HTTP Request?

Thank you!

Upvotes: 1

Views: 1503

Answers (1)

Jared Eitnier
Jared Eitnier

Reputation: 7152

You need to build an artisan command and then call it in your crontab:

* 0 * * * php /usr/share/nginx/html/example.com/artisan tns:delete-old-jobs --env=production >/dev/null 2>$1

Have the artisan command trigger your API method.

Upvotes: 3

Related Questions