Hi Dev’s, Now in this example, i will teach you how to create folder in laravel application. we can easily create a new directory in our laravel application. So now we will solved simply define the command then we a create directory in laravel application. here i will teach you how to create directory in laravel.
Here we are just trying to use File::makeDirectory to create a new folder from public path.
/** * Show the application dashboard. * * @return \Illuminate\Contracts\Support\Renderable */ public function index(Request $request) { $file = public_path('image'); $result = File::makeDirectory($file); dd($result); }
It will return true if this method success, and it will return false if this method fails.
solution for php
/** * Show the application dashboard. * * @return \Illuminate\Contracts\Support\Renderable */ public function index(Request $request) { $file = public_path('images'); $result = mkdir($file); dd($result); }
It will return true if this method success, and it will return false if this method fails.
Read Also : symlink(): No such file or directory laravel ubuntu – solved
Thanks for read. I hope it help you. For more you can follow us on facebook