How to change the place where files are saved?


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
11 views
Code to save image
$request->file('cover_image')->storeAs('/storage/cover_images', $fileNameToStore);

and folder tree(lsapp everything in it except the public directory and in public_html that same public)
5aeca40a6bc5f506684166.png
The problem is that when you change the folder structure such that files stored in lsapp/storage/app/storage/cover_image
And it is necessary in public_html/storage/cover_image

When I try to change folder save
$request->file('cover_image')->storeAs('../../storage/cover_images', $fileNameToStore);

issues
Path is outside of the defined root, path: [../../storage/cover_images/123_1525452472.jpg]
by | 11 views

2 Answers

0 like 0 dislike
Put your disc in config/filesystems.php with the desired address and use it
stackoverflow
by
0 like 0 dislike
To open the documentation and read the filesystem#configuration
by

Related questions

0 like 0 dislike
2 answers
asked Jun 2, 2019 by Jhon_Light
0 like 0 dislike
1 answer
0 like 0 dislike
2 answers
0 like 0 dislike
2 answers
110,608 questions
257,186 answers
0 comments
35,649 users