Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
pterodactyl
GitHub Repository: pterodactyl/panel
Path: blob/1.0-develop/database/Factories/DatabaseFactory.php
7458 views
1
<?php
2
3
namespace Database\Factories;
4
5
use Carbon\Carbon;
6
use Illuminate\Support\Str;
7
use Pterodactyl\Models\Database;
8
use Illuminate\Database\Eloquent\Factories\Factory;
9
10
class DatabaseFactory extends Factory
11
{
12
/**
13
* The name of the factory's corresponding model.
14
*
15
* @var string
16
*/
17
protected $model = Database::class;
18
19
/**
20
* Define the model's default state.
21
*/
22
public function definition(): array
23
{
24
static $password;
25
26
return [
27
'database' => Str::random(10),
28
'username' => Str::random(10),
29
'remote' => '%',
30
'password' => $password ?: encrypt('test123'),
31
'created_at' => Carbon::now(),
32
'updated_at' => Carbon::now(),
33
];
34
}
35
}
36
37