CreateCartItems::down()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 1
c 1
b 0
f 1
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
use Illuminate\Database\Schema\Blueprint;
4
use Illuminate\Database\Capsule\Manager as Capsule;
5
6
/**
7
 * Class CreateCartItems
8
 */
9
class CreateCartItems
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...
10
{
11
    /**
12
     * Run the migrations.
13
     *
14
     * @return void
15
     */
16
    public function up()
17
    {
18
        Capsule::schema()->create('cart_items', function (Blueprint $table) {
19
            $table->increments('id')->index()->unique();
20
            $table->integer('user_id')->unique();
21
            $table->json('data');
22
            $table->timestamps();
23
            $table->softDeletes();
24
        });
25
    }
26
    /**
27
     * Reverse the migrations.
28
     *
29
     * @return void
30
     */
31
    public function down()
32
    {
33
        Capsule::schema()->dropIfExists('cart_items');
34
    }
35
}