lasthourcloud/database/seeders/PrivateKeySeeder.php

31 lines
1.0 KiB
PHP
Raw Normal View History

<?php
namespace Database\Seeders;
use App\Models\PrivateKey;
use App\Models\Server;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
class PrivateKeySeeder extends Seeder
{
/**
* Run the database seeds.
*/
public function run(): void
{
$server = Server::find(1);
PrivateKey::create([
"name" => "Testing-host",
"description" => "This is a test docker container",
"private_key" => "-----BEGIN OPENSSH PRIVATE KEY-----\
b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAMwAAAAtzc2gtZW\
QyNTUxOQAAACBbhpqHhqv6aI67Mj9abM3DVbmcfYhZAhC7ca4d9UCevAAAAJi/QySHv0Mk\
hwAAAAtzc2gtZWQyNTUxOQAAACBbhpqHhqv6aI67Mj9abM3DVbmcfYhZAhC7ca4d9UCevA\
AAAECBQw4jg1WRT2IGHMncCiZhURCts2s24HoDS0thHnnRKVuGmoeGq/pojrsyP1pszcNV\
uZx9iFkCELtxrh31QJ68AAAAEXNhaWxANzZmZjY2ZDJlMmRkAQIDBA==\
-----END OPENSSH PRIVATE KEY-----",
])->private_key_morph()->associate($server)->save();
}
}