In this post, we will guide you how to create folder in storage in laravel 6 application. we can easily create directory if not exists using File or Storage facade in laravel 6 project. i will give you simple and more solution of laravel 6 make folder in public folder or storage folder.
I will give you more way to create folder in public folder in laravel 6. you can see i will use File facade to create folder, Storage facade will use to create directory from storage in laravel 6 and also i will give you simple code core php to create folder.
Using File System:
public function createDirecrotory(Request $request)
$path = public_path('upload/itsolutionstuff.com');
File::makeDirectory($path, 0777, true, true);
Using Storage System:
public function createFolder()
$response = Storage::makeDirectory('upload/itsolutionstuff.com');
Using Core PHP:
public function removeFolder()
$folderPath = public_path('uploads');
$response = mkdir($folderPath);
It will help you...
Do you like below Tutorials ?
- Laravel Select Query if Condition Example | Laravel Sql Case When
- How to Copy Text to Clipboard in Angular?
- Angular Show Hide Div on Radio Button Example
- Laravel 8 Livewire Image Upload Example
- Laravel 5.7 Image Upload with Validation Example
- How to Remove Item from Collection Laravel?
- Install or upgrade php 7.2 to 7.3 ubuntu command
- JQuery Count Child Elements in Div with Class Example
- Laravel 8 Send Mail using Markdown Mailables Example
- Laravel Delete Row by id Example
- How to Convert Object to String in Jquery?
- Godaddy Shared Hosting Increase PHP Memory