This is an approach to get the solution of this problem: Imagine that you want to get all files inside a subdirectory and you want to show the url like: yoursite.com/files/folders/first
. But you need also to go to yoursite.com/files/folders/second/inside
.
How can you achieve that?
With the Laravel Regular Expression Constraint
Route::get('/files/{path?}', 'MyController@view')->where('path', '.*');