Issues (364)

app/Jobs/Tenant/DropTb.php (2 issues)

1
<?php
2
3
namespace App\Jobs\Tenant;
4
5
use App\Models\Company;
6
use App\Service\Tenant;
7
use Illuminate\Bus\Queueable;
8
use Illuminate\Contracts\Queue\ShouldQueue;
9
use Illuminate\Foundation\Bus\Dispatchable;
10
use Illuminate\Queue\InteractsWithQueue;
11
use Illuminate\Queue\SerializesModels;
12
use Illuminate\Support\Facades\DB;
13
use LaravelEnso\Multitenancy\Enums\Connections;
0 ignored issues
show
The type LaravelEnso\Multitenancy\Enums\Connections was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
14
15
class DropTb implements ShouldQueue
16
{
17
    use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
0 ignored issues
show
The trait Illuminate\Queue\SerializesModels requires some properties which are not provided by App\Jobs\Tenant\DropTb: $collectionClass, $id, $relations, $class, $keyBy
Loading history...
18
19
    /**
20
     * Create a new job instance.
21
     *
22
     * @return void
23
     */
24
    public function __construct(private readonly Company $tenant)
25
    {
26
        // $this->queue = 'light';
27
    }
28
29
    /**
30
     * Execute the job.
31
     *
32
     * @return void
33
     */
34
    public function handle()
35
    {
36
        Tenant::set($this->tenant);
37
38
        DB::connection(Connections::Tenant)
39
            ->getSchemaBuilder()
40
            ->dropAllTables();
41
    }
42
}
43