From 1753111f8fb1fd0f382ba04fa2392083966c3673 Mon Sep 17 00:00:00 2001 From: Deon George Date: Tue, 4 Jun 2024 18:40:04 +1000 Subject: [PATCH] Prefix is an optional argument, so default it to blank --- app/Console/Commands/EchoareaImport.php | 2 +- app/Console/Commands/FileareaImport.php | 2 +- app/Jobs/EchoareaImport.php | 2 +- app/Jobs/FileareaImport.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/Console/Commands/EchoareaImport.php b/app/Console/Commands/EchoareaImport.php index 6dfb3b8..01ba12e 100644 --- a/app/Console/Commands/EchoareaImport.php +++ b/app/Console/Commands/EchoareaImport.php @@ -35,6 +35,6 @@ class EchoareaImport extends Command public function handle(): int { $do = Domain::where('name',strtolower($this->argument('domain')))->singleOrFail(); - return Job::dispatchSync($this->argument('file'),$do,$this->option('prefix'),$this->option('unlink')); + return Job::dispatchSync($this->argument('file'),$do,$this->option('prefix') ?: '',$this->option('unlink')); } } \ No newline at end of file diff --git a/app/Console/Commands/FileareaImport.php b/app/Console/Commands/FileareaImport.php index 6832e0e..8efd8df 100644 --- a/app/Console/Commands/FileareaImport.php +++ b/app/Console/Commands/FileareaImport.php @@ -35,6 +35,6 @@ class FileareaImport extends Command public function handle(): int { $do = Domain::where('name',strtolower($this->argument('domain')))->singleOrFail(); - return Job::dispatchSync($this->argument('file'),$do,$this->option('prefix'),$this->option('unlink')); + return Job::dispatchSync($this->argument('file'),$do,$this->option('prefix') ?: '',$this->option('unlink')); } } \ No newline at end of file diff --git a/app/Jobs/EchoareaImport.php b/app/Jobs/EchoareaImport.php index a8f0b42..9469211 100644 --- a/app/Jobs/EchoareaImport.php +++ b/app/Jobs/EchoareaImport.php @@ -35,7 +35,7 @@ class EchoareaImport implements ShouldQueue * @param bool $delete_recs * @param bool $delete_file */ - public function __construct(string $file,Domain $do,string $prefix,bool $delete_recs=FALSE,bool $delete_file=FALSE) + public function __construct(string $file,Domain $do,string $prefix='',bool $delete_recs=FALSE,bool $delete_file=FALSE) { $this->file = $file; $this->do = $do; diff --git a/app/Jobs/FileareaImport.php b/app/Jobs/FileareaImport.php index 464ce7a..5cfa049 100644 --- a/app/Jobs/FileareaImport.php +++ b/app/Jobs/FileareaImport.php @@ -35,7 +35,7 @@ class FileareaImport implements ShouldQueue * @param bool $delete_recs * @param bool $delete_file */ - public function __construct(string $file,Domain $do,string $prefix,bool $delete_recs=FALSE,bool $delete_file=FALSE) + public function __construct(string $file,Domain $do,string $prefix='',bool $delete_recs=FALSE,bool $delete_file=FALSE) { $this->file = $file; $this->do = $do;