mkdir(): No such file or directory - laravel
laravel, laravel-5
Solution
Change the line
File::makeDirectory(public_path().'/'.$path,0777);
to
File::makeDirectory(public_path().'/'.$path,0777,true);
So that the sub-directories are also created.
Problem
I would like to create a directory but I got this error : ``` ErrorException in Filesystem.php line 390: mkdir(): No such file or directoryErrorException in Filesystem.php line 390: mkdir(): No such file or directory in Filesystem.php line 390 at HandleExceptions->handleError('2', 'mkdir(): No such file or directory', 'C:\xampp\htdocs\yatan\yatan\vendor\laravel\framework\src\Illuminate\Filesystem\Filesystem.php', '390', array('path' => 'C:\xampp\htdocs\yatan\yatan\public/assets/images/projects/1/1476592434/', 'mode' => '511', 'recursive' => false, 'force' => false)) ``` my code : ``` $to_main_image = time(); $path = 'assets/images/projects/'.$user_id.'/'.$to_main_image.'/'; File::makeDirectory(public_path().'/'.$path,0777); ```