Laravel - what's the difference between storeAs vs storePubliclyAs? Files are going to the same folder anyway

23 views Asked by At

I have Livewire component where user can upload product photo. I want that photo to go to public folder, which is /storage/app/public by default (fresh Laravel installation).

/**
 * @var TemporaryUploadedFile
 */
public $photo;

public function updatedPhoto() {
    $path = $this->photo->storePublicly();
}

But the file goes directly to /storage/app instead of /storage/app/public. If I call ->store() the result is exactly the same.

The documentation says: ->storePublicly(): "Store the uploaded file on a filesystem disk with public visibility." but I really don't understand the difference.

Can somebody clear this out?

0

There are 0 answers