Support the ongoing development of Laravel.io →
Queues Architecture
Last updated 1 year ago.
0

I think you can put it anywhere you want. If you look at the app/Console/Kernel.php file, you will see a ** protected $commands** field which is an array of available commands you want to schedule. As for your custom class, you can place it anywhere you see fit. For application commands, I usually just use the default command directory created by artisan.

In summary simply specify the full class name to your command class as the Inspire example shows. For the scheduling, you can do:

$schedule->command('command')->daily();
0

If you made your own custom class / service etc, you don't need to be making a command for each one.

->command("command arg1 arg 2 --param=value") is for artisan commands

Use

$schedule->call('App\Name\Of\Your\Class@method')->daily();

Laravel magic will make it happen!

Cheers!

0

Sign in to participate in this thread!

Eventy

Your banner here too?

VenomRush venomrush Joined 27 May 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.