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

Illegal characters on Windows for model binding #77

Closed
froberts0n opened this issue Aug 8, 2023 · 2 comments
Closed

Illegal characters on Windows for model binding #77

froberts0n opened this issue Aug 8, 2023 · 2 comments

Comments

@froberts0n
Copy link

Folio Version

1.0.0-beta.4

Laravel Version

10.18.0

PHP Version

8.2.8

Description

When trying to create a page named [Model:key].blade.php for model binding, Windows won't allow ":" in file names.

I don't know if we could use an alternate character on Windows, or if we could just add another character with the same effect but that would be valid on Windows (so Linux users would have 2 ways of writing it).

On Windows, these are illegal characters in filenames: \ / : * ? " < > |

So I guess we could use characters that are illegal in PHP classes and function names such as: ! @ # $ % & ; , . ~

I'm sorry because I love the ":" separator, it's very clear and nice. Just unusable on Windows.

Steps To Reproduce

On Windows

$ php artisan make:folio things/[Thing:number]

   INFO  Page [C:\laragon\www\application\resources\views\pages/things/[Thing:number].blade.php] created successfully.

Creates an empty folder named "thing" instead.

@froberts0n
Copy link
Author

Well, guess what! Just read the code and found out that "-" works!
Closing it now! :)
Sorry!

@Dimimo
Copy link

Dimimo commented Sep 27, 2023

Don't be sorry 😌 It's a golden tip because it's not in the Laravel documentation. Although my production server runs on GNIX, the testserver is on a windows 10 computer with XAMPP & PHP 8.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants