laravel / folio

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

[1.x] Fixes Wildcard Directories Modifying State for Literal Views in the Base Folder #115

Closed nunomaduro closed 1 year ago

nunomaduro commented 1 year ago

Fixes https://github.com/laravel/folio/issues/114.

In this example:

- movies/[Movie]/index.blade.php
- movies/[Movie]/characters.blade.php
- movies/index.blade.php
- movies/create.blade.php

Since [Movie] is a wildcard directory, all requests made to movies/** were considered as potentially having a model bind routable segment. So, a request made to movies/create was returning a 404 because create is not the ID of any movie.

Now, with my pull request, the state is only mutated with model bind routable segments if there are plans to continue iterating. If that is not the case (for example, for literal views like movies/create), we simply move to the next element of the pipeline with the initial state.