Как сохранить загруженный файл в правильном каталоге с помощью Laravel Livewire 3?Php

Кемеровские программисты php общаются здесь
Anonymous
Как сохранить загруженный файл в правильном каталоге с помощью Laravel Livewire 3?

Сообщение Anonymous »


I have this page that uploads the user's avatar to the the app. I'm using Livewire 3, so it should be simple.

// validation $user->avatar = $this->photo->store('avatars'); $user->save(); Now, this works, but instead of storing the file in /storage/app/public/avatar it uploads it to /storage/app/avatar so I can't see the files in the browser. Field in the database has the hash and file extension, so it's working, and if I go directly to the directory, of course they're there.

This won't work:


Изображение
avatar }}"> neither


Изображение
avatar }}"> But if I manually move the /avatar directory inside /storage/app/public, it works.

This must be a configuration issue for sure, but I don't know what. I don't find it in the Laravel documentation or Livewire's, it should be working like magic, but it's not.

Thanks!


Источник: https://stackoverflow.com/questions/780 ... l-livewire

Вернуться в «Php»