mirror of
https://github.com/brufdev/many-notes.git
synced 2026-01-25 04:18:51 -06:00
23 lines
501 B
PHP
23 lines
501 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Actions;
|
|
|
|
use App\Models\VaultNode;
|
|
|
|
final readonly class GetUrlFromVaultNode
|
|
{
|
|
public function handle(VaultNode $node): string
|
|
{
|
|
/**
|
|
* @var string $fullPath
|
|
*
|
|
* @phpstan-ignore-next-line larastan.noUnnecessaryCollectionCall
|
|
*/
|
|
$fullPath = $node->ancestorsAndSelf()->get()->last()->full_path;
|
|
|
|
return '/files/' . $node->vault_id . '?path=' . $fullPath . '.' . $node->extension;
|
|
}
|
|
}
|