To generate all active feeds, use the console command:
php artisan feed:generate
As a result, all active feeds (is_active = true) will be executed from the feeds table (or the one you specified in the config/feeds.php file).
Single feed
To generate a specific feed, call the feed:generate console command, passing the feed ID from the feeds table as its parameter:
php artisan feed:generate 123
Schedule
Automatic
To automate feed generation, use a schedule. To do this, specify the helper call in the routes/console.php file (the default path, unless you have changed it):
use DragonCode\LaravelFeed\Helpers\ScheduleFeedHelper;
use Illuminate\Support\Facades\Schedule;
ScheduleFeedHelper::register();
Schedule::call(function () {
// ... other action
})->everySecond();
This will enable you to register calls to all active feeds according to the schedule you specified in the expression column of the database.
Manual
You can also specify the schedule directly according to your own rules. In this case, only the feeds you specify will be executed.
use DragonCode\LaravelFeed\Commands\FeedGenerateCommand;
use Illuminate\Support\Facades\Schedule;
Schedule::command(FeedGenerateCommand::class, [111])
->withoutOverlapping()
->runInBackground()
->daily();
Schedule::command(FeedGenerateCommand::class, [222])
->withoutOverlapping()
->runInBackground()
->hourly();
Schedule::call(function () {
// ... other action
})->everySecond();