File tree Expand file tree Collapse file tree 2 files changed +14
-3
lines changed
packages/data/src/Console/Commands Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change 2121 "require" : {
2222 "filament/spatie-laravel-media-library-plugin" : " 3.x-dev" ,
2323 "laravel/framework" : " ^12.0" ,
24+ "laravel/horizon" : " 5.x-dev" ,
2425 "laravel/telescope" : " 5.x-dev" ,
2526 "laravel/tinker" : " ^2.8" ,
2627 "moox/audit" : " *" ,
163164 },
164165 "minimum-stability" : " dev" ,
165166 "prefer-stable" : false
166- }
167+ }
Original file line number Diff line number Diff line change 77
88class ImportStaticDataCommand extends Command
99{
10- protected $ signature = 'moox:data:import-static ' ;
10+ protected $ signature = 'moox:data:import-static {--sync : Run the import synchronously} ' ;
1111
1212 protected $ description = 'Import static data from REST Countries API ' ;
1313
1414 public function handle ()
1515 {
16- ImportStaticDataJob::dispatch ();
16+ $ this ->info ('Starting static data import... ' );
17+
18+ if ($ this ->option ('sync ' )) {
19+ $ this ->info ('Running import synchronously... ' );
20+ (new ImportStaticDataJob )->handle ();
21+ $ this ->info ('Import completed! ' );
22+ } else {
23+ $ this ->info ('Dispatching import job to queue... ' );
24+ ImportStaticDataJob::dispatch ();
25+ $ this ->info ('Job dispatched! Make sure your queue worker is running. ' );
26+ }
1727 }
1828}
You can’t perform that action at this time.
0 commit comments