Laravel App em execução no console
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();
});
}
}