akubiczek /
applicake-backend
| 1 | <?php |
||
| 2 | |||
| 3 | namespace App\Queue\Jobs; |
||
| 4 | |||
| 5 | use App\Models\Tenant; |
||
| 6 | use Illuminate\Support\Facades\Config; |
||
| 7 | use Illuminate\Support\Facades\DB; |
||
| 8 | |||
| 9 | class DatabaseJob extends \Illuminate\Queue\Jobs\DatabaseJob |
||
| 10 | { |
||
| 11 | public function fire() |
||
| 12 | { |
||
| 13 | if ($this->job->tenant_id) { |
||
| 14 | $tenant = Tenant::findOrFail($this->job->tenant_id); |
||
|
0 ignored issues
–
show
Unused Code
introduced
by
Loading history...
|
|||
| 15 | Config::set('database.connections.tenant.database', 'tenant_'.$this->job->tenant_id); |
||
| 16 | DB::purge('tenant'); |
||
| 17 | } |
||
| 18 | |||
| 19 | parent::fire(); |
||
| 20 | } |
||
| 21 | } |
||
| 22 |