Update and fix broadband traffic

This commit is contained in:
Deon George
2022-04-20 16:24:58 +10:00
parent 621a132e35
commit 16b7e0b493
13 changed files with 161 additions and 112 deletions

View File

@@ -5,7 +5,7 @@ namespace App\Console\Commands;
use Illuminate\Console\Command;
use App\Jobs\BroadbandTraffic as Job;
use App\Models\AdslSupplier;
use App\Models\Supplier;
class BroadbandTraffic extends Command
{
@@ -14,7 +14,8 @@ class BroadbandTraffic extends Command
*
* @var string
*/
protected $signature = 'broadband:traffic:import';
protected $signature = 'broadband:traffic:import'.
' {--s|supplier= : Supplier Name}';
/**
* The console command description.
@@ -30,7 +31,14 @@ class BroadbandTraffic extends Command
*/
public function handle()
{
foreach (AdslSupplier::active()->get() as $o)
if ($this->option('supplier')) {
$o = Supplier::where('name','like',$this->option('supplier'))->singleOrFail();
Job::dispatch($o);
return;
}
foreach (Supplier::active()->get() as $o)
Job::dispatch($o);
}
}