Files
many-notes/app/Actions/ResolveTwoPaths.php
T
Bruno b2b86fe513 Add Vault show page
Add VaultNode CRUD features
Add VaultNode search feature
Add TreeView component
2024-10-04 19:37:43 +01:00

19 lines
404 B
PHP

<?php
namespace App\Actions;
use GuzzleHttp\Psr7\Utils;
use Illuminate\Support\Str;
use GuzzleHttp\Psr7\UriResolver;
class ResolveTwoPaths
{
public function handle(string $currentPath, string $path): string
{
$uri = Utils::uriFor(trim($path));
$resolvedUri = UriResolver::resolve(Utils::uriFor(trim($currentPath)), $uri);
return Str::ltrim($resolvedUri, '/');
}
}