Completed
Push — master ( 7e131c...271c01 )
by Reza
27s queued 20s
created

CreateCrudsTableEasypanel::getConnection()   A

Complexity

Conditions 2
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
use Illuminate\Database\Migrations\Migration;
4
use Illuminate\Database\Schema\Blueprint;
5
use Illuminate\Support\Facades\Schema;
6
7
class CreateCrudsTableEasypanel extends Migration
8
{
9
    /**
10
     * {@inheritdoc}
11
     */
12
    public function getConnection()
13
    {
14
        return config('easy_panel_config.database.connection') ?: config('database.default');
15
    }
16
17
    /**
18
     * Run the migrations.
19
     *
20
     * @return void
21
     */
22
    public function up()
23
    {
24
        Schema::create(config('easy_panel_config.database.crud_table'), function (Blueprint $table) {
25
            $table->id();
26
            $table->string('name')->unique();
27
            $table->string('model')->unique();
28
            $table->string('route')->unique();
29
            $table->string('icon')->default('fas fa-bars');
30
            $table->boolean('active')->default(true);
31
            $table->boolean('built')->default(false);
32
            $table->boolean('with_acl')->default(false);
33
            $table->boolean('with_policy')->default(false);
34
            $table->timestamps();
35
        });
36
    }
37
38
    /**
39
     * Reverse the migrations.
40
     *
41
     * @return void
42
     */
43
    public function down()
44
    {
45
        Schema::dropIfExists(config('easy_panel_config.database.crud_table'));
46
    }
47
}
48