These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | use Illuminate\Database\Schema\Blueprint; |
||
4 | use Illuminate\Database\Migrations\Migration; |
||
5 | use Illuminate\Support\Facades\Config; |
||
6 | use Illuminate\Support\Facades\Schema; |
||
7 | |||
8 | class CreateUserTokensTable extends Migration |
||
0 ignored issues
–
show
|
|||
9 | { |
||
10 | |||
11 | /** |
||
12 | * @var string $tableName - Table name. |
||
13 | */ |
||
14 | protected $tableName; |
||
15 | |||
16 | /** |
||
17 | * Initialise the migration. |
||
18 | */ |
||
19 | public function __construct() |
||
20 | { |
||
21 | $this->tableName = Config::get('jwt.claim_table_name'); |
||
22 | } |
||
23 | |||
24 | /** |
||
25 | * Run the migrations. |
||
26 | * |
||
27 | * @return void |
||
28 | */ |
||
29 | public function up() |
||
30 | { |
||
31 | Schema::create($this->tableName, function (Blueprint $table) { |
||
32 | $table->increments('id'); |
||
33 | $table->string('subject')->unsigned(); |
||
34 | $table->string('audience')->unsigned(); |
||
35 | $table->string('jwt_id')->index(); |
||
36 | $table->timestamps(); |
||
37 | }); |
||
38 | } |
||
39 | |||
40 | /** |
||
41 | * Reverse the migrations. |
||
42 | * |
||
43 | * @return void |
||
44 | */ |
||
45 | public function down() |
||
46 | { |
||
47 | Schema::drop($this->tableName); |
||
48 | } |
||
49 | |||
50 | } |
||
51 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.