| Total Complexity | 2 |
| Total Lines | 40 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 8 | class CreateUsersTable extends Migration |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * Run the migrations. |
||
| 12 | * |
||
| 13 | * @return void |
||
| 14 | */ |
||
| 15 | public function up() |
||
| 16 | { |
||
| 17 | Schema::create('users', function (Blueprint $table) { |
||
| 18 | $table->increments('user_id'); |
||
| 19 | $table->string('username')->unique; |
||
| 20 | $table->string('first_name'); |
||
| 21 | $table->string('last_name'); |
||
| 22 | $table->string('email')->unique(); |
||
| 23 | $table->string('password'); |
||
| 24 | $table->rememberToken(); |
||
| 25 | $table->boolean('active'); |
||
| 26 | $table->timestamps(); |
||
| 27 | }); |
||
| 28 | |||
| 29 | User::create([ |
||
| 30 | 'user_id' => 1, |
||
| 31 | 'username' => 'admin', |
||
| 32 | 'first_name' => 'System', |
||
| 33 | 'last_name' => 'Administrator', |
||
| 34 | 'email' => '[email protected]', |
||
| 35 | 'password' => bcrypt('password'), |
||
| 36 | 'active' => 1 |
||
| 37 | ]); |
||
| 38 | } |
||
| 39 | |||
| 40 | /** |
||
| 41 | * Reverse the migrations. |
||
| 42 | * |
||
| 43 | * @return void |
||
| 44 | */ |
||
| 45 | public function down() |
||
| 48 | } |
||
| 49 | } |
||
| 50 |