|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
declare(strict_types=1); |
|
4
|
|
|
|
|
5
|
|
|
use Illuminate\Support\Facades\Schema; |
|
6
|
|
|
use Illuminate\Database\Schema\Blueprint; |
|
7
|
|
|
use Illuminate\Database\Migrations\Migration; |
|
8
|
|
|
|
|
9
|
|
|
class CreateAdminsTable extends Migration |
|
|
|
|
|
|
10
|
|
|
{ |
|
11
|
|
|
/** |
|
12
|
|
|
* Run the migrations. |
|
13
|
|
|
* |
|
14
|
|
|
* @return void |
|
15
|
|
|
*/ |
|
16
|
|
|
public function up(): void |
|
17
|
|
|
{ |
|
18
|
|
|
Schema::create(config('cortex.auth.tables.admins'), function (Blueprint $table) { |
|
19
|
|
|
// Columns |
|
20
|
|
|
$table->increments('id'); |
|
21
|
|
|
$table->string('username'); |
|
22
|
|
|
$table->string('password'); |
|
23
|
|
|
$table->rememberToken(); |
|
24
|
|
|
$table->string('email'); |
|
25
|
|
|
$table->boolean('email_verified')->default(false); |
|
26
|
|
|
$table->timestamp('email_verified_at')->nullable(); |
|
27
|
|
|
$table->string('phone')->nullable(); |
|
28
|
|
|
$table->boolean('phone_verified')->default(false); |
|
29
|
|
|
$table->timestamp('phone_verified_at')->nullable(); |
|
30
|
|
|
$table->string('name_prefix')->nullable(); |
|
31
|
|
|
$table->string('first_name')->nullable(); |
|
32
|
|
|
$table->string('middle_name')->nullable(); |
|
33
|
|
|
$table->string('last_name')->nullable(); |
|
34
|
|
|
$table->string('name_suffix')->nullable(); |
|
35
|
|
|
$table->string('title')->nullable(); |
|
36
|
|
|
$table->string('country_code', 2)->nullable(); |
|
37
|
|
|
$table->string('language_code', 2)->nullable(); |
|
38
|
|
|
$table->text('two_factor')->nullable(); |
|
39
|
|
|
$table->date('birthday')->nullable(); |
|
40
|
|
|
$table->string('gender')->nullable(); |
|
41
|
|
|
$table->boolean('is_active')->default(true); |
|
42
|
|
|
$table->timestamp('last_activity')->nullable(); |
|
43
|
|
|
$table->auditableAndTimestamps(); |
|
|
|
|
|
|
44
|
|
|
$table->softDeletes(); |
|
45
|
|
|
|
|
46
|
|
|
// Indexes |
|
47
|
|
|
$table->unique('email'); |
|
48
|
|
|
$table->unique('username'); |
|
49
|
|
|
}); |
|
50
|
|
|
} |
|
51
|
|
|
|
|
52
|
|
|
/** |
|
53
|
|
|
* Reverse the migrations. |
|
54
|
|
|
* |
|
55
|
|
|
* @return void |
|
56
|
|
|
*/ |
|
57
|
|
|
public function down(): void |
|
58
|
|
|
{ |
|
59
|
|
|
Schema::dropIfExists(config('cortex.auth.tables.admins')); |
|
60
|
|
|
} |
|
61
|
|
|
} |
|
62
|
|
|
|
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.