ImportPdfCommand.php 518 B

1234567891011121314151617181920212223
  1. <?php
  2. namespace App\Console\Commands;
  3. use App\Jobs\ProcessPdfJob;
  4. use Illuminate\Console\Command;
  5. class ImportPdfCommand extends Command
  6. {
  7. protected $signature = 'question:import-pdf {path}';
  8. protected $description = 'Import pdf questions into pre_question_candidates';
  9. public function handle(): int
  10. {
  11. $path = (string) $this->argument('path');
  12. ProcessPdfJob::dispatch($path);
  13. $this->info(sprintf('Queued pdf import for %s', $path));
  14. return self::SUCCESS;
  15. }
  16. }