CreateContactsTable::up()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 15
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 11
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 15
rs 9.9
1
<?php
2
3
use Illuminate\Support\Facades\Schema;
4
use Illuminate\Support\Facades\Artisan;
5
use Illuminate\Database\Schema\Blueprint;
6
use Illuminate\Database\Migrations\Migration;
7
8
class CreateContactsTable extends Migration
9
{
10
    /**
11
     * Run the migrations.
12
     *
13
     * @return void
14
     */
15
    public function up()
16
    {
17
        Schema::create('contacts', function (Blueprint $table) {
18
            $table->id();
19
            $table->string('name');
20
            $table->string('email')->nullable();
21
            $table->bigInteger('phone')->nullable();
22
            $table->tinyInteger('gender')->default(1);
23
            $table->string('address')->default('N/A');
24
            $table->boolean('favorite')->default(0);
25
            $table->boolean('active')->default(1);
26
            $table->timestamps();
27
        });
28
29
        Artisan::call('make:permission Contact --all');
30
    }
31
32
    /**
33
     * Reverse the migrations.
34
     *
35
     * @return void
36
     */
37
    public function down()
38
    {
39
        Schema::dropIfExists('contacts');
40
    }
41
}
42