With creating a Request with namespace in Laravel

2

I tried to create a Request with a subnamespace in Laravel 5, but without success.

When I run the command php artisan make:request Temp\OsRequest , instead of creating a file named OsRequest inside a Temp folder, a class called TempOsRequest is created.

Is there any way to create this class, with the subnamespace, already inside a folder, the way I need it?

    
asked by anonymous 23.05.2016 / 20:18

1 answer

2

Yes, there is.

Remember that in many cases the \ character represents an escape of some character.

If you add two slashes ( \ ), the command will work as expected, and the Temp folder will be created within app\Http\Request , and the OsRequest class will be created with the Temp subnamespace set .

See an example:

php artisan make:request Temp\OsRequest
    
23.05.2016 / 20:18