ParseCars.php 532 B

1234567891011121314151617181920212223
  1. <?php
  2. namespace App\Console\Commands;
  3. use App\Services\Parser\Parser;
  4. use Illuminate\Console\Attributes\Description;
  5. use Illuminate\Console\Attributes\Signature;
  6. use Illuminate\Console\Command;
  7. #[Signature('app:parse-cars')]
  8. #[Description('Command description')]
  9. class ParseCars extends Command
  10. {
  11. /**
  12. * Execute the console command.
  13. */
  14. public function handle()
  15. {
  16. $cars = (new Parser())->run();
  17. file_put_contents('cars.json', json_encode($cars, JSON_PRETTY_PRINT));
  18. dd($cars);
  19. }
  20. }