test env
This commit is contained in:
@@ -32,6 +32,8 @@ class DatabaseSeeder extends Seeder
|
|||||||
'owner_id' => 1,
|
'owner_id' => 1,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
$organisation->members()->attach($user, ['role' => OrganisationRole::ADMIN]);
|
||||||
|
|
||||||
$provider = $organisation->providers()->create([
|
$provider = $organisation->providers()->create([
|
||||||
'name' => 'Hetzner',
|
'name' => 'Hetzner',
|
||||||
'type' => ProviderType::HETZNER,
|
'type' => ProviderType::HETZNER,
|
||||||
@@ -54,8 +56,6 @@ class DatabaseSeeder extends Seeder
|
|||||||
|
|
||||||
$organisation->servers()->saveMany($servers);
|
$organisation->servers()->saveMany($servers);
|
||||||
|
|
||||||
$organisation->members()->attach($user, ['role' => OrganisationRole::ADMIN]);
|
|
||||||
|
|
||||||
$application = $organisation->applications()->create([
|
$application = $organisation->applications()->create([
|
||||||
'name' => 'ClipBin',
|
'name' => 'ClipBin',
|
||||||
'repository_url' => 'git@github.com:hjbdev/clipbin.git',
|
'repository_url' => 'git@github.com:hjbdev/clipbin.git',
|
||||||
|
|||||||
35
database/seeders/TestEnvironmentSeeder.php
Normal file
35
database/seeders/TestEnvironmentSeeder.php
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Database\Seeders;
|
||||||
|
|
||||||
|
use App\Enums\OrganisationRole;
|
||||||
|
use App\Enums\ProviderType;
|
||||||
|
use App\Models\Organisation;
|
||||||
|
use App\Models\User;
|
||||||
|
use Illuminate\Support\Facades\Hash;
|
||||||
|
|
||||||
|
class TestEnvironmentSeeder
|
||||||
|
{
|
||||||
|
public function run(): void
|
||||||
|
{
|
||||||
|
$user = User::factory()->create([
|
||||||
|
'name' => 'Harry',
|
||||||
|
'email' => 'harry@hjb.dev',
|
||||||
|
'password' => env('DEFAULT_PASSWORD') ?: Hash::make('password'),
|
||||||
|
]);
|
||||||
|
|
||||||
|
$organisation = Organisation::create([
|
||||||
|
'name' => 'Stratbucket',
|
||||||
|
'slug' => 'stratbucket',
|
||||||
|
'owner_id' => 1,
|
||||||
|
]);
|
||||||
|
|
||||||
|
$organisation->members()->attach($user, ['role' => OrganisationRole::ADMIN]);
|
||||||
|
|
||||||
|
$organisation->providers()->create([
|
||||||
|
'name' => 'Hetzner',
|
||||||
|
'type' => ProviderType::HETZNER,
|
||||||
|
'token' => env('HETZNER_KEY'),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user