laravel / folio

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

Route::has doesn't pick up folio pages #92

Closed jdion84 closed 1 year ago

jdion84 commented 1 year ago

Folio Version

1

Laravel Version

10

PHP Version

8

Description

Route::has doesn't seem to pick up folio pages.

Example, in my navbar:

@if(Route::has('login'))
    <a href="{{ route('login') }}">
        {{ __('Login') }}
    </a>
@endif

In my login.blade.php page:

use function Laravel\Folio\name;

name('login');

My link for the login page doesn't show up in the navbar.

Steps To Reproduce

Create a view that uses Route::has to check if a named folio page exists. Seems to always be false.

nunomaduro commented 1 year ago

I think it may be hard to address this issue at the moment; however, feel free to perform a pull request on this one!

aledbrown commented 9 months ago

What this addressed? I can't get @if(Route::has('a.named.folio.page')) to work either.

Seems useful in normal Laravel projects to check that a route exists before rendering a link it to a Blade template instead f throwing an error when it doesn't.

Folio is a great project by the way.