CreateRecentViewsTables   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 8
c 0
b 0
f 0
dl 0
loc 20
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A down() 0 3 1
A up() 0 9 1
1
<?php
2
3
use Illuminate\Database\Migrations\Migration;
4
use Illuminate\Database\Schema\Blueprint;
5
use Illuminate\Support\Facades\Schema;
6
7
class CreateRecentViewsTables extends Migration
8
{
9
    public function up()
10
    {
11
        Schema::create(config('recently-viewed.persist_table'), function (Blueprint $table) {
12
            $table->bigIncrements('id');
13
            $table->morphs('viewer');
14
            // $table->uuidMorphs('viewer');
15
            $table->string('type');
16
            $table->text('views');
17
            $table->timestamps();
18
        });
19
    }
20
21
    /**
22
    * Reverse the migrations.
23
    */
24
    public function down()
25
    {
26
        Schema::dropIfExists(config('recently-viewed.persist_table'));
27
    }
28
}
29