update seeders and factories to support Laravel 8

This commit is contained in:
Matthew Penner
2021-01-15 17:19:25 -07:00
parent 0db332990f
commit f449d8b999
20 changed files with 14 additions and 6 deletions

View File

@@ -1,5 +1,7 @@
<?php
namespace Database\Factories;
use Carbon\Carbon;
use Ramsey\Uuid\Uuid;
use Cake\Chronos\Chronos;
@@ -7,6 +9,7 @@ use Illuminate\Support\Str;
use Pterodactyl\Models\Node;
use Faker\Generator as Faker;
use Pterodactyl\Models\ApiKey;
use Illuminate\Support\Facades\Crypt;
/** @var \Illuminate\Database\Eloquent\Factory $factory */
/*
@@ -188,8 +191,8 @@ $factory->define(Pterodactyl\Models\ApiKey::class, function (Faker $faker) {
return [
'key_type' => ApiKey::TYPE_APPLICATION,
'identifier' => str_random(Pterodactyl\Models\ApiKey::IDENTIFIER_LENGTH),
'token' => $token ?: $token = encrypt(str_random(Pterodactyl\Models\ApiKey::KEY_LENGTH)),
'identifier' => str_random(\Pterodactyl\Models\ApiKey::IDENTIFIER_LENGTH),
'token' => $token ?: $token = encrypt(str_random(\Pterodactyl\Models\ApiKey::KEY_LENGTH)),
'allowed_ips' => null,
'memo' => 'Test Function Key',
'created_at' => Carbon::now()->toDateTimeString(),