-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcallbacks.php
More file actions
30 lines (24 loc) · 971 Bytes
/
callbacks.php
File metadata and controls
30 lines (24 loc) · 971 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php
use Illuminate\Database\Schema\Blueprint;
return [
App\Events\PluginWasEnabled::class => function () {
if (!Schema::hasTable('invitation_codes')) {
Schema::create('invitation_codes', function ($table) {
$table->increments('id');
$table->string('code', 255);
$table->dateTime('generated_at');
$table->integer('used_by')->default(0);
$table->dateTime('used_at')->nullable();
});
}
if (!Schema::hasColumn('invitation_codes', 'description')) {
Schema::table('invitation_codes', function (Blueprint $table) {
$table->string('description')->nullable();
});
}
option(['invitation_codes_for_union_enabled' => true]);
},
App\Events\PluginWasDisabled::class => function () {
option(['invitation_codes_for_union_enabled' => false]);
},
];