Приложение Laravel, работающее в консоли
app()->runningInConsole()
Riat Cloud
app()->runningInConsole()
public function boot()
{
if ($this->app->runningInConsole()) {
$this->commands([
PackageCommandClassNameHere::class,
]);
$this->app->booted(function () {
$schedule = $this->app->make(Schedule::class);
$schedule->command('signature:command')->everyTwoHours();
});
}
}