I want to send my articles to my Telegram channel automatically by the date time I have scheduled, so I should use queue or cron job.
I have used queue, so in local development to send notifications to telegram I refresh the webpage, I don’t want it like this, when deployed to production I want it to auto-send when I have scheduled.
2
Answers
I think the cron job will suits best for the scenario, kindly refer the task scheduling from the laravel documentation for the same : https://laravel.com/docs/9.x/scheduling
You should create a Laravel Command. Take you code from the controller and put it there.
Then, add a schedule: app/Console/Kernel.php
Finally; using terminal
Also, you can create a schedule cron to run your command:telegram