laravel / folio

Page based routing for Laravel.
MIT License
568 stars 46 forks source link

Fix returning the url of a Folio route when the base `uri` is not the default one #87

Closed alexmanase closed 1 year ago

alexmanase commented 1 year ago

When someone uses the name function for defining the name of a Folio route, Folio does not look for the $baseUri.

For example:

There is this Blade file with this name:

<?php // resources/views/team/nuno-maduro.blade.php

\Laravel\Folio\name('nuno');

?>

and has this defined Folio route:

Folio::route(
    path: resource_path('/views/team'),
    uri: '/team-members'
);
route('nuno') => '/nuno-maduro' ❌ This is the path returned.
route('nuno') => '/team-members/nuno-maduro' ✅ This is the path that should be returned.

This PR fixes this bug.

nunomaduro commented 1 year ago

I will fix this here https://github.com/laravel/folio/pull/88. Thank you!