12345678910111213141516171819202122232425262728293031323334 |
- <?php
- namespace App\Jobs;
- use Illuminate\Bus\Queueable;
- use Illuminate\Contracts\Queue\ShouldQueue;
- use Illuminate\Foundation\Bus\Dispatchable;
- use Illuminate\Queue\InteractsWithQueue;
- use Illuminate\Queue\SerializesModels;
- use Illuminate\Support\Facades\Artisan;
- use Stancl\Tenancy\Contracts\TenantWithDatabase;
- class InitTenantData implements ShouldQueue
- {
- use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
- protected TenantWithDatabase $tenant;
- public function __construct(TenantWithDatabase $tenant)
- {
- $this->tenant = $tenant;
- }
- /**
- * Execute the job.
- */
- public function handle(): void
- {
- Artisan::call('tenants:run', [
- 'commandname' => 'lpc:initialize-route-permission',
- '--tenants' => [$this->tenant->getTenantKey()],
- ]);
- }
- }
|