Added Echoarea NA file import
This commit is contained in:
40
app/Console/Commands/EchoareaImport.php
Normal file
40
app/Console/Commands/EchoareaImport.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\Models\Domain;
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
use App\Jobs\EchoareaImport as Job;
|
||||
|
||||
class EchoareaImport extends Command
|
||||
{
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'echoarea:import'
|
||||
.' {file : NA File}'
|
||||
.' {domain : Domain}'
|
||||
.' {--P|prefix= : Add prefix to description}'
|
||||
.' {--U|unlink : Delete file after import}';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Import Echoarea';
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$do = Domain::where('name',strtolower($this->argument('domain')))->singleOrFail();
|
||||
return Job::dispatchSync($this->argument('file'),$do,$this->option('prefix'),$this->option('unlink'));
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user