CreateCartItems   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 3
Bugs 1 Features 3
Metric Value
c 3
b 1
f 3
dl 0
loc 25
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A up() 0 8 1
A down() 0 3 1
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
}