I would like to create a folder inside Storage folder in Laravel 5, once you register and pick your username, a folder with that user will be created for you.
If you created user : john5500 a folder inside Storage will be created with 'john5500' and will belong only to that user.
Mark, see the code below.
This code I use to create a new user in my database.
Information about ManagementCreateRequest $Request can be found via this URL.
Laravel Controller Validation
In short I'm validating my input via Controller Validation in Laravel. After the validation passes I get all the data from the validation in the variable $Request.
After that I create the user as below. After creating the user I send a redirect to the management page. This page contains an overview of all the users in the database.
If I would to create a directory I would do it like this.
Replace /path/to/directory with the actual path to your storage directory. For example: Under CentOS my storage directory would be.
/var/www/Site Name/storage
Don't forget to replace 'Site Name' with the name of your Laravel site.
More detailed information about File:makeDirectory can be found via this link:
Laravel Creating Directory