1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/* |
4
|
|
|
* NOTICE OF LICENSE |
5
|
|
|
* |
6
|
|
|
* Part of the Rinvex Fort Package. |
7
|
|
|
* |
8
|
|
|
* This source file is subject to The MIT License (MIT) |
9
|
|
|
* that is bundled with this package in the LICENSE file. |
10
|
|
|
* |
11
|
|
|
* Package: Rinvex Fort Package |
12
|
|
|
* License: The MIT License (MIT) |
13
|
|
|
* Link: https://rinvex.com |
14
|
|
|
*/ |
15
|
|
|
|
16
|
|
|
use Illuminate\Support\Facades\Schema; |
17
|
|
|
use Illuminate\Database\Schema\Blueprint; |
18
|
|
|
use Illuminate\Database\Migrations\Migration; |
19
|
|
|
|
20
|
|
|
class CreateUsersTable extends Migration |
|
|
|
|
21
|
|
|
{ |
22
|
|
|
/** |
23
|
|
|
* Run the migrations. |
24
|
|
|
* |
25
|
|
|
* @return void |
26
|
|
|
*/ |
27
|
|
|
public function up() |
28
|
|
|
{ |
29
|
|
|
Schema::create(config('rinvex.fort.tables.users'), function (Blueprint $table) { |
|
|
|
|
30
|
|
|
// Columns |
31
|
|
|
$table->increments('id'); |
32
|
|
|
$table->string('username'); |
33
|
|
|
$table->string('password'); |
34
|
|
|
$table->rememberToken(); |
35
|
|
|
$table->string('email'); |
36
|
|
|
$table->boolean('email_verified')->default(false); |
37
|
|
|
$table->timestamp('email_verified_at')->nullable(); |
38
|
|
|
$table->string('phone')->nullable(); |
39
|
|
|
$table->boolean('phone_verified')->default(false); |
40
|
|
|
$table->timestamp('phone_verified_at')->nullable(); |
41
|
|
|
$table->string('prefix')->nullable(); |
42
|
|
|
$table->string('first_name')->nullable(); |
43
|
|
|
$table->string('middle_name')->nullable(); |
44
|
|
|
$table->string('last_name')->nullable(); |
45
|
|
|
$table->string('suffix')->nullable(); |
46
|
|
|
$table->string('job_title')->nullable(); |
47
|
|
|
$table->string('country', 2)->nullable(); |
48
|
|
|
$table->text('two_factor')->nullable(); |
49
|
|
|
$table->date('birthdate')->nullable(); |
50
|
|
|
$table->enum('gender', [ |
51
|
|
|
'male', |
52
|
|
|
'female', |
53
|
|
|
'undisclosed', |
54
|
|
|
])->default('undisclosed'); |
55
|
|
|
$table->boolean('active')->default(true); |
56
|
|
|
$table->timestamp('login_at')->nullable(); |
57
|
|
|
$table->timestamps(); |
58
|
|
|
$table->softDeletes(); |
59
|
|
|
|
60
|
|
|
// Indexes |
61
|
|
|
$table->unique('email'); |
62
|
|
|
$table->unique('username'); |
63
|
|
|
|
64
|
|
|
// Engine |
65
|
|
|
$table->engine = 'InnoDB'; |
66
|
|
|
}); |
67
|
|
|
} |
68
|
|
|
|
69
|
|
|
/** |
70
|
|
|
* Reverse the migrations. |
71
|
|
|
* |
72
|
|
|
* @return void |
73
|
|
|
*/ |
74
|
|
|
public function down() |
75
|
|
|
{ |
76
|
|
|
Schema::drop(config('rinvex.fort.tables.users')); |
77
|
|
|
} |
78
|
|
|
} |
79
|
|
|
|
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.