Technical notes about OctoberCMS a Laravel CMS by inetis team, a Swiss webagency

<- Back

Cron without command line

Posted on by

In a perfect world, all your clients will be on great host and on VPS server. But we had to deal also with crappy host that only provide fake cron job. They call a public https/http url every X min

We had to send a newsletter with the Campaing Plugin. This plugin required to run

    php artisan campaign:run

every 15min. This send the emails in batch.

To solve the problem, we are using the Artisan Facade. Create a routes.php file in the root folder of the plugin with the route:

    use Route;
    use Artisan;

    Route::get('/campaign_run', function () {
    return Artisan::call('campaign:run');
    });

OctoberCMS documentation about routing : https://octobercms.com/docs/services/router#basic-routing