diff --git a/app/Console/Commands/ServiceList.php b/app/Console/Commands/ServiceList.php index da3417b..7e0330f 100644 --- a/app/Console/Commands/ServiceList.php +++ b/app/Console/Commands/ServiceList.php @@ -50,7 +50,6 @@ class ServiceList extends Command )); foreach (Service::withoutGlobalScope(\App\Models\Scopes\SiteScope::class)->with(['site'])->cursor() as $o) { - //dd($o,$o->site); if ((! $this->option('inactive')) AND ! $o->isActive()) continue; diff --git a/app/Console/Commands/TestEmail.php b/app/Console/Commands/TestEmail.php index 47882ec..3a5726c 100644 --- a/app/Console/Commands/TestEmail.php +++ b/app/Console/Commands/TestEmail.php @@ -3,10 +3,11 @@ namespace App\Console\Commands; use Illuminate\Console\Command; +use Illuminate\Support\Facades\Config; use Illuminate\Support\Facades\Mail; use App\Mail\TestEmail as MailTest; -use App\Models\User; +use App\Models\{Site,User}; class TestEmail extends Command { @@ -15,7 +16,7 @@ class TestEmail extends Command * * @var string */ - protected $signature = 'test:email {id}'; + protected $signature = 'test:email {site : Site ID} {id : User ID} {email? : Alternative Email}'; /** * The console command description. @@ -41,9 +42,11 @@ class TestEmail extends Command */ public function handle() { + Config::set('site',Site::findOrFail($this->argument('site'))); + $uo = User::find($this->argument('id')); - Mail::to($uo->email) + Mail::to($this->argument('email') ?? $uo->email) ->send(new MailTest($uo)); } } \ No newline at end of file