CreateSettingsTable::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 0
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
use Arcanedev\Support\Bases\Migration;
4
use Illuminate\Database\Schema\Blueprint;
5
6
/**
7
 * Class     CreateSettingsTable
8
 *
9
 * @author   ARCANEDEV <[email protected]>
10
 */
11
class CreateSettingsTable extends Migration
12
{
13
    /* ------------------------------------------------------------------------------------------------
14
     |  Constructor
15
     | ------------------------------------------------------------------------------------------------
16
     */
17
    /**
18
     * CreateSettingsTable constructor.
19
     */
20
    public function __construct()
21
    {
22
        $configs          = config('arcanesoft.settings.database');
23
        $this->connection = array_get($configs, 'connection', null);
24
        $this->table      = array_get($configs, 'table', 'settings');
25
    }
26
27
    /* ------------------------------------------------------------------------------------------------
28
     |  Main Functions
29
     | ------------------------------------------------------------------------------------------------
30
     */
31
    /**
32
     * {@inheritdoc}
33
     */
34
    public function up()
35
    {
36
        $this->createSchema(function(Blueprint $table) {
37
            $table->increments('id');
38
39
            $table->string('domain')->nullable();
40
            $table->string('key');
41
            $table->text('value');
42
            $table->enum('type', ['integer', 'real', 'float', 'double', 'string', 'boolean', 'object', 'array']);
43
44
            $table->timestamps();
45
        });
46
    }
47
}
48