CreateCategorizableTable   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A up() 0 8 1
1
<?php
2
3
use Arcanedev\Taxonomies\Bases\Migration;
4
use Illuminate\Database\Schema\Blueprint;
5
6
/**
7
 * Class     CreateCategorizableTable
8
 *
9
 * @author   ARCANEDEV <[email protected]>
10
 */
11
class CreateCategorizableTable extends Migration
12
{
13
    /* ------------------------------------------------------------------------------------------------
14
     |  Constructor
15
     | ------------------------------------------------------------------------------------------------
16
     */
17
    public function __construct()
18
    {
19
        parent::__construct();
20
21
        $this->setTable(config('taxonomies.categories.morph.table', 'categories_relations'));
22
    }
23
24
    /* ------------------------------------------------------------------------------------------------
25
     |  Main Functions
26
     | ------------------------------------------------------------------------------------------------
27
     */
28
    /**
29
     * Migrate to database.
30
     */
31
    public function up()
32
    {
33
        $this->createSchema(function (Blueprint $table) {
34
            $table->integer('category_id');
35
            $table->morphs(config('taxonomies.categories.morph.name', 'categorizable'));
36
            $table->timestamps();
37
        });
38
    }
39
}
40