Completed
Push — develop ( bad89c...4b21ec )
by Abdelrahman
10:54
created

CreateAddressesTable   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 3
dl 0
loc 32
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
B up() 0 24 1
A down() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
use Illuminate\Support\Facades\Schema;
5
use Illuminate\Database\Schema\Blueprint;
6
use Illuminate\Database\Migrations\Migration;
7
8
class CreateAddressesTable extends Migration
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
9
{
10
    public function up()
11
    {
12
        Schema::create(config('rinvex.addresses.tables.addresses'), function (Blueprint $table) {
13
            // Columns
14
            $table->increments('id');
15
            $table->morphs('addressable');
16
            $table->string('given_name');
17
            $table->string('family_name');
18
            $table->string('label')->nullable();
19
            $table->string('organization')->nullable();
20
            $table->string('country_code', 2)->nullable();
21
            $table->string('street')->nullable();
22
            $table->string('state')->nullable();
23
            $table->string('city')->nullable();
24
            $table->string('postal_code')->nullable();
25
            $table->decimal('latitude', 10, 7)->nullable();
26
            $table->decimal('longitude', 10, 7)->nullable();
27
            $table->boolean('is_primary')->default(false);
28
            $table->boolean('is_billing')->default(false);
29
            $table->boolean('is_shipping')->default(false);
30
            $table->timestamps();
31
            $table->softDeletes();
32
        });
33
    }
34
35
    public function down()
36
    {
37
        Schema::dropIfExists(config('rinvex.addresses.tables.addresses'));
38
    }
39
}
40