mirror of
https://github.com/MrUnknownDE/panel.git
synced 2026-04-18 22:33:44 +02:00
Merge branch 'develop' into laravel-8
This commit is contained in:
32
database/factories/BackupFactory.php
Normal file
32
database/factories/BackupFactory.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use Ramsey\Uuid\Uuid;
|
||||
use Pterodactyl\Models\Backup;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
class BackupFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* The name of the factory's corresponding model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $model = Backup::class;
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'uuid' => Uuid::uuid4()->toString(),
|
||||
'is_successful' => true,
|
||||
'name' => $this->faker->sentence,
|
||||
'disk' => Backup::ADAPTER_WINGS,
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -29,7 +29,7 @@ class DatabaseFactory extends Factory
|
||||
'database' => Str::random(10),
|
||||
'username' => Str::random(10),
|
||||
'remote' => '%',
|
||||
'password' => $password ?: bcrypt('test123'),
|
||||
'password' => $password ?: encrypt('test123'),
|
||||
'created_at' => Carbon::now(),
|
||||
'updated_at' => Carbon::now(),
|
||||
];
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
namespace Database\Factories;
|
||||
|
||||
use Pterodactyl\Models\Subuser;
|
||||
use Pterodactyl\Models\Permission;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
class SubuserFactory extends Factory
|
||||
@@ -21,6 +22,10 @@ class SubuserFactory extends Factory
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
return [];
|
||||
return [
|
||||
'permissions' => [
|
||||
Permission::ACTION_WEBSOCKET_CONNECT
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user