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

CreateAddressesTable::up()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 24
Code Lines 20

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 24
rs 8.9713
c 0
b 0
f 0
cc 1
eloc 20
nc 1
nop 0
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