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();
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!
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community