A
A
Alexander Koregin2020-02-21 16:17:03
Laravel
Alexander Koregin, 2020-02-21 16:17:03

How to save a photo in public?

I'm doing a photo service and I need to save photos at this address site.ru/photos

Filesystems.php

'public' => [
            'driver' => 'local',
            'root' => public_path(''),
            'url' => env('APP_URL'),
            'visibility' => 'public',
        ],

Code for saving a photo
$path = $request->file('photo')->store('photos','public');

I can’t understand where the error is, the photos folder is being created, but I can’t access it from public, because it is created along the path storage / app / public / photos /

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Anton, 2020-02-21
@dragonika8

https://laravel.com/docs/6.x/filesystem#the-public-disk

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question