With creating a Request with namespace in Laravel

Asked

Viewed 785 times

2

I tried to create a Request with a subnamespace in Laravel 5, but to no avail.

When I turn the remote php artisan make:request Temp\OsRequest, instead of creating a file called OsRequest inside a briefcase Temp, a class is created called TempOsRequest.

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

1 answer

2


Yes, there is.

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

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

Take an example :

php artisan make:request Temp\\OsRequest

Browser other questions tagged

You are not signed in. Login or sign up in order to post.