ImportMaf.php 786 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. namespace App\Console\Commands;
  3. use App\Services\ImportService;
  4. use Exception;
  5. use Illuminate\Console\Command;
  6. use Illuminate\Support\Facades\Storage;
  7. use PhpOffice\PhpSpreadsheet\IOFactory;
  8. class ImportMaf extends Command
  9. {
  10. /**
  11. * The name and signature of the console command.
  12. *
  13. * @var string
  14. */
  15. protected $signature = 'app:import-maf {path} {year}';
  16. /**
  17. * The console command description.
  18. *
  19. * @var string
  20. */
  21. protected $description = 'Импорт каталога МАФ';
  22. /**
  23. * Execute the console command.
  24. * @throws Exception
  25. */
  26. public function handle(): void
  27. {
  28. // run service command
  29. (new ImportService)->handle($this->argument('path'), $this->argument('year'));
  30. }
  31. }