24 lines
578 B
PHP
24 lines
578 B
PHP
<?php
|
|
|
|
namespace Modules\Core\Providers;
|
|
|
|
use Illuminate\Console\Scheduling\Schedule;
|
|
use Illuminate\Support\ServiceProvider;
|
|
use Modules\Core\Cart\Commands\DetectAbandonedCarts;
|
|
|
|
class CartServiceProvider extends ServiceProvider
|
|
{
|
|
public function boot(): void
|
|
{
|
|
if ($this->app->runningInConsole()) {
|
|
$this->commands([DetectAbandonedCarts::class]);
|
|
}
|
|
|
|
$this->app->booted(function () {
|
|
$this->app->make(Schedule::class)
|
|
->command(DetectAbandonedCarts::class)
|
|
->hourly();
|
|
});
|
|
}
|
|
}
|