I want to change the image destination of laravel.

Asked 2 years ago, Updated 2 years ago, 115 views

In the default directory of laravel, the image is stored in storage/app/public, but I would like to change the destination of the image to the public/images file, what should I do?

laravel laravel-5

2022-09-30 19:10

1 Answers

I think this content is useful.
How to upload files in Ravel directory into public folder?

I just translated the steps in the answers to the links above, but how about following them?

'public_uploads'=>[
    'driver' = > 'local',
    'root' = > public_path(),
],

$request->file('img')->storeAs('images', 'image.png', 'public_uploads');
*If the image was sent as img and you want to save it in public/images under the name image.png


2022-09-30 19:10

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.