|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
use App\Model\Plugin; |
|
4
|
|
|
use Illuminate\Database\Schema\Blueprint; |
|
5
|
|
|
use Illuminate\Database\Migrations\Migration; |
|
6
|
|
|
use App\Classes\Repositories\PluginRepository; |
|
7
|
|
|
|
|
8
|
|
|
class CreateCarouselsTable extends Migration |
|
9
|
|
|
{ |
|
10
|
|
|
/** |
|
11
|
|
|
* Run the migrations. |
|
12
|
|
|
* |
|
13
|
|
|
* @return void |
|
14
|
|
|
*/ |
|
15
|
|
|
public function up() |
|
16
|
|
|
{ |
|
17
|
|
|
\Schema::create('carousels', function (Blueprint $table) { |
|
18
|
|
|
$table->increments('id'); |
|
19
|
|
|
$table->string('title'); |
|
20
|
|
|
$table->string('style'); |
|
21
|
|
|
$table->boolean('lock'); |
|
22
|
|
|
$table->unsignedInteger('creator_id'); |
|
23
|
|
|
$table->unsignedInteger('editor_id')->nullable(); |
|
24
|
|
|
$table->softDeletes(); |
|
25
|
|
|
$table->timestamps(); |
|
26
|
|
|
}); |
|
27
|
|
|
|
|
28
|
|
|
\Schema::create('carousel_slides', function (Blueprint $table) { |
|
29
|
|
|
$table->increments('id'); |
|
30
|
|
|
$table->string('title')->nullable(); |
|
31
|
|
|
$table->unsignedInteger('carousel_id'); |
|
32
|
|
|
$table->unsignedInteger('image_id')->nullable(); |
|
33
|
|
|
$table->string('link_url'); |
|
34
|
|
|
$table->string('link_target'); |
|
35
|
|
|
$table->integer('order_id'); |
|
36
|
|
|
$table->unsignedInteger('creator_id'); |
|
37
|
|
|
$table->unsignedInteger('editor_id')->nullable(); |
|
38
|
|
|
$table->softDeletes(); |
|
39
|
|
|
$table->timestamps(); |
|
40
|
|
|
}); |
|
41
|
|
|
|
|
42
|
|
|
/** @var Plugin $plugin */ |
|
43
|
|
|
$plugin = new Plugin(); |
|
44
|
|
|
$plugin->setName('carousels'); |
|
45
|
|
|
$plugin->setVersion('1.0'); |
|
46
|
|
|
$plugin->setIcon('fa-fast-forward'); |
|
47
|
|
|
$plugin->setBackEnd(true); |
|
48
|
|
|
$plugin->save(); |
|
49
|
|
|
} |
|
50
|
|
|
|
|
51
|
|
|
/** |
|
52
|
|
|
* Reverse the migrations. |
|
53
|
|
|
* |
|
54
|
|
|
* @return void |
|
55
|
|
|
*/ |
|
56
|
|
|
public function down() |
|
57
|
|
|
{ |
|
58
|
|
|
\Schema::drop('carousels'); |
|
59
|
|
|
|
|
60
|
|
|
\Schema::drop('carousel_slides'); |
|
61
|
|
|
|
|
62
|
|
|
app(PluginRepository::class)->whereName('carousels')->delete(); |
|
|
|
|
|
|
63
|
|
|
} |
|
64
|
|
|
} |
|
65
|
|
|
|
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.