Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace App\Console;
- use Illuminate\Console\Scheduling\Schedule;
- use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
- class Kernel extends ConsoleKernel
- {
- /**
- * The Artisan commands provided by your application.
- *
- * @var array
- */
- protected $commands = [
- // Product commands
- \App\Console\Commands\Products\SyncToShopify::class,
- \App\Console\Commands\Products\SyncDeleted::class,
- \App\Console\Commands\Products\Download::class,
- \App\Console\Commands\Products\Inactivate::class,
- \App\Console\Commands\Inventory\SyncInventory::class,
- \App\Console\Commands\Inventory\ClearBin::class,
- \App\Console\Commands\Inventory\ClearInventory::class,
- \App\Console\Commands\Collections\SyncToShopify::class,
- \App\Console\Commands\Collections\SyncDeleted::class,
- \App\Console\Commands\Collections\Download::class,
- \App\Console\Commands\CollectionProducts\SyncToShopify::class,
- \App\Console\Commands\CollectionProducts\SyncDeleted::class,
- \App\Console\Commands\Orders\Download::class,
- \App\Console\Commands\Orders\Refund::class,
- \App\Console\Commands\Orders\RefundMoney::class,
- \App\Console\Commands\Orders\Cancel::class,
- \App\Console\Commands\Orders\Upload::class,
- \App\Console\Commands\Dailydeals\SwitchDeals::class,
- \App\Console\Commands\Shipments\CreateScanForm::class,
- \App\Console\Commands\Shipments\Correct::class
- ];
- /**
- * Define the application's command schedule.
- *
- * @param \Illuminate\Console\Scheduling\Schedule $schedule
- * @return void
- */
- protected function schedule(Schedule $schedule)
- {
- // @ORDERS
- // Download orders
- $schedule->command('orders:download')->everyMinute()->withoutOverlapping();
- // Inform customer of tracking number
- $schedule->command('orders:upload')->everyTenMinutes()->withoutOverlapping();
- // Cancel pending orders
- $schedule->command('orders:cancel')->hourly()->withoutOverlapping();
- // @PRODUCTS|VARIANTS
- // sync any products that need syncing
- $schedule->command('products:sync')->everyThirtyMinutes()->withoutOverlapping();
- // delete any products that need deleting
- $schedule->command('products:delete')->everyThirtyMinutes()->withoutOverlapping();
- // Delete any variants that need deleting
- // $schedule->command('variants:delete')
- // ->everyTenMinutes()
- // ->withoutOverlapping();
- // @INVENTORY
- // Sync any inventory
- $schedule->command('inventory:sync')->hourly()->withoutOverlapping();
- // @COLLECTIONS
- // sync any collections that need syncing
- $schedule->command('collections:sync')->everyFiveMinutes()->withoutOverlapping();
- // delete any collections that need deleting
- $schedule->command('collections:delete')->everyTenMinutes()->withoutOverlapping();
- // sync any collection products that need syncing
- $schedule->command('collectionproducts:sync')->everyFiveMinutes()->withoutOverlapping();
- // delete any collection products that need deleting
- $schedule->command('collectionproducts:delete')->everyFiveMinutes()->withoutOverlapping();
- // // Refund pending orders
- // $schedule->command('orders:refund')
- // ->everyTenMinutes()
- // ->withoutOverlapping();
- // $schedule->command('orders:refund_money')
- // ->everyTenMinutes()
- // ->withoutOverlapping();
- // Command to switch deals at noon
- $schedule->command('deals:switch')->dailyAt('12:00')->withoutOverlapping();
- // Command to print a scan form at 9pm and print it
- $schedule->command('shipments:scanform')->dailyAt('21:00')->withoutOverlapping();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement