Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with . in route name ? #13

Closed
stefanzweifel opened this Issue Apr 1, 2019 · 6 comments

Comments

Projects
None yet
3 participants
@stefanzweifel
Copy link

stefanzweifel commented Apr 1, 2019

Currently working on an app which has version numbers in it's URLs. When running php artisan export these routes are not correctly recognized and no index.html files are generated.

Works :)
https://laravel-download-statistics-4a844a.netlify.com/downloads/by-month/2019-03/

Fails :(
https://laravel-download-statistics-4a844a.netlify.com/downloads/by-version/v5.8

image

Might this be related with #10 ? Maybe the export command should check against a list of common file-types?

@sebastiandedeyne

This comment has been minimized.

Copy link
Member

sebastiandedeyne commented Apr 2, 2019

Sounds good to do a better kind of detenction for file types 👍

@stefanzweifel

This comment has been minimized.

Copy link
Author

stefanzweifel commented Apr 2, 2019

Great. Will look into this more and send a PR if I found a good solution.

@SL0wZEr

This comment has been minimized.

Copy link
Contributor

SL0wZEr commented Apr 2, 2019

What about fixing this with a simple regular expression? excluding any "version-like" paths.

$isFile = isset(explode('.', $url->getPath())[1]) && ! preg_match('/(.+\.[0-9]+)/', $url->getPath());

Or it could also be something like this:

$isFile = preg_match('/(.+\.[a-z]+([0-9]+)?)/', $url->getPath());

Screenshot

@stefanzweifel

This comment has been minimized.

Copy link
Author

stefanzweifel commented Apr 3, 2019

@SL0wZEr both of your ideas worked great for me. Do you want to create the PR for this? 😄

@SL0wZEr

This comment has been minimized.

Copy link
Contributor

SL0wZEr commented Apr 3, 2019

@stefanzweifel would love to. I'll send a PR tonight :)

@sebastiandedeyne

This comment has been minimized.

Copy link
Member

sebastiandedeyne commented Apr 5, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.