laravel / folio

Page based routing for Laravel.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Illegal characters on Windows for model binding

froberts0n opened this issue · comments

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.

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