Fix: Populate SSH keys in dev
This commit is contained in:
22
database/seeders/PopulateSshKeysDirectorySeeder.php
Normal file
22
database/seeders/PopulateSshKeysDirectorySeeder.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use App\Models\PrivateKey;
|
||||
|
||||
class PopulateSshKeysDirectorySeeder extends Seeder
|
||||
{
|
||||
public function run()
|
||||
{
|
||||
Storage::disk('ssh-keys')->deleteDirectory('');
|
||||
Storage::disk('ssh-keys')->makeDirectory('');
|
||||
|
||||
PrivateKey::chunk(100, function ($keys) {
|
||||
foreach ($keys as $key) {
|
||||
$key->storeInFileSystem();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user