define storage instances with phpdoc

This commit is contained in:
Saeed Vaziry
2024-01-03 22:31:50 +01:00
parent 31bd146239
commit 2d7f225ff2
9 changed files with 29 additions and 14 deletions

View File

@ -343,10 +343,13 @@ public function sshKey(): array
];
}
/** @var \Illuminate\Filesystem\FilesystemAdapter $storageDisk */
$storageDisk = Storage::disk(config('core.key_pairs_disk'));
return [
'public_key' => Str::replace("\n", '', Storage::disk(config('core.key_pairs_disk'))->get($this->id.'.pub')),
'public_key_path' => Storage::disk(config('core.key_pairs_disk'))->path($this->id.'.pub'),
'private_key_path' => Storage::disk(config('core.key_pairs_disk'))->path((string) $this->id),
'public_key_path' => $storageDisk->path($this->id.'.pub'),
'private_key_path' => $storageDisk->path((string) $this->id),
];
}