kyouzano
kyouzano

Reputation: 55

How to create storage folder and sub folder using input names in laravel 5

i am need advice to create folder upload in storage, i want to make folder using 4 column textbox

how to make folder like this

storage/app/division/year/activity/sponsor/file.txt

and the code here

storage::disk('local')->put('logic');

Upvotes: 4

Views: 5325

Answers (1)

Moppo
Moppo

Reputation: 19275

Once you have sanitized and stored the input strings in the relative variables, to create the folder and upload the file you can do:

Storage::disk('local')
    ->put( $division .'/'. $activity . '/' . $year . '/' . $sponsor . '/file.txt',
           File::get( <your_file> )
);

Upvotes: 5

Related Questions