Add ApiKey service, cleanup old API key methods

https://zube.io/pterodactyl/panel/c/525
This commit is contained in:
Dane Everitt 2017-06-25 15:31:50 -05:00
parent 2235481765
commit 4ee9d38ad1
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
10 changed files with 569 additions and 85 deletions

View file

@ -0,0 +1,36 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class ChangeForeignKeyToBeOnCascadeDelete extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('api_permissions', function (Blueprint $table) {
$table->dropForeign(['key_id']);
$table->foreign('key_id')->references('id')->on('api_keys')->onDelete('cascade');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('api_permissions', function (Blueprint $table) {
$table->dropForeign(['key_id']);
$table->foreign('key_id')->references('id')->on('api_keys');
});
}
}