Having created a new user, the avatar was showing as a broken image. I uploaded a new image, but the image remained broken.
I checked with Console in Google Chrome and found 3 404 errors:
2017-06-19 10:53:50.159 http://localhost:8888/storage/users/June2017/ypKlbqbATDbpnYctZBFp.png Failed to load resource: the server responded with a status of 404 (Not Found)
2017-06-19 10:53:50.256 http://localhost:8888/storage/users/June2017/ypKlbqbATDbpnYctZBFp.png Failed to load resource: the server responded with a status of 404 (Not Found)
2017-06-19 10:53:50.473 http://localhost:8888/vendor/tcg/voyager/assets/images/bg.jpg Failed to load resource: the server responded with a status of 404 (Not Found)
When I looked at the project, the paths for the 2 storage errors are: http://localhost:8888/storage/app/public/users/ and: http://localhost:8888/storage/app/public/users/June2017
Is this a configuration error?
While in Media with Voyager itself, I'm seeing similar path problems when navigating the folders:
2017-06-19 11:38:22.248 %7B%7B%20selected_file.path%20%7D%7D:1 GET http://localhost:8888/development/PhpstormProjects/Search4Venues/public/admin/%7B%7B%20selected_file.path%20%7D%7D 404 (Not Found)
Hi @user0018, that setting is already in place.
Hi @user0018:
macbookpro:Search4Venues macbookpro$ php artisan storage:link
The "public/storage" directory already exists.
As I said, I see those directories when navigating via the Finder.
Hi, anyone have an idea what I need to do?
I had the same issues last time, but I did that way. Can you try built in server:
php artisan serve
and adjust the .env:
APP_URL=http://localhost:8000
Hi @uchsarath, I ran the command but the paths are still wrong:
http://localhost:8888/storage/users/June2017/ypKlbqbATDbpnYctZBFp.png Failed to load resource: the server responded with a status of 404 (Not Found)
2017-06-20 07:50:37.237 http://localhost:8888/vendor/tcg/voyager/assets/images/bg.jpg Failed to load resource: the server responded with a status of 404 (Not Found)
Also, @user0018 suggested the change to APP_URL but I'd made that change during the initial configuration.
While looking at the file: filesystems.php I found the variable: disks, and it appears to be those path variables that are getting ignored.
A colleague with more experience than me has been through Voyager and found some inconsistencies, which he's attempted to fix.
In app.php, we've had to change:
'url' => env('APP_URL', 'http://localhost:8888/development/PhpstormProjects/Search4Venues'),
... to:
'url' => env('APP_URL', 'http://localhost:8888'),
In filesystems.php, we've had to change:
'public' => [
'driver' => 'local',
'root' => storage_path('app/public'),
'url' => env('APP_URL').'/storage',
'visibility' => 'public',
]
... to:
'public' => [
'driver' => 'local',
'root' => storage_path('app/public'),
'url' => env('APP_URL').'/development/PhpstormProjects/Search4Venues/public/storage',
'visibility' => 'public',
]
However, he discovered other problems in config/voyager.php:
'assets_path' => '/vendor/tcg/voyager/assets',
... where it too was missing PhpstormProjects/Search4Venues from the path:
http://localhost:8888/vendor/tcg/voyager/assets/images/bg.jpg
At this stage, we have no idea what else could be wrong with Voyager.
These are not issues with Voyager, they're issues with how you have your environment set up (not following best-practices).
I'm willing to bet your Search4Venues directory is the root of the laravel install (i.e. it has a .env and public/ folder in it). You really should set up your webserver to use a vhost pointing at your /path/to/laravel/public/ directory.
There are a number of steps that need to be taken if you choose to install laravel in a subdirectory, and virtually none of them are specific to Voyager. There are numerous resources online to help with this.
If you have specific issues/questions regarding this, you're welcome to join our slack group and ask there.
Hi @fletch3555, where are the instructions that state otherwise?
I've followed the instructions in this repo to the letter (as has the colleague who assisted), so you appear to have other instructions that — as far as I see — haven't been provided.
There are a number of steps that need to be taken if you choose to install laravel in a subdirectory, and virtually none of them are specific to Voyager.
What are those steps?
There are numerous resources online to help with this.
Where are those resources? I've been at this a week and haven't seen anything like you're describing.
In light of this, closing the issue does not help.
Hi @fletch3555, I'm in the actual Voyager Documentation, looking at the installation instructions, and there is no specific mention of where to install, let alone where not.
Your advice would be appreciated, given it exceeds what's in the official documentation.
For any issues to do with images, please be aware that laravel caches some routes. Please run php artisan config:clear to reset defaults and clear cached image routes. Then delete your storage link, in your public folder and run php artisan storage:link. This fixed all errors to do with the BREAD controller images not working.
Have you fixed the problem
try to use
APP_URL=http://127.0.0.1:8000
instead of
APP_URL=http://localhost:8888
/*
* Package Service Providers...
*/
TCG\Voyager\VoyagerServiceProvider::class,
Intervention\Image\ImageServiceProvider::class,
In the end, for technical reasons it wasn't possible to get Laravel working, and instead connect to an installation on an EC3 instance.
i had the same problem but i fixed it by changing :
in app.php : 'url' => env('APP_URL', 'http://localhost'), by 'url' => env('APP_URL', 'http://127.0.0.1:8000'),
and in .env
APP_URL=http://localhost by APP_URL=http://127.0.0.1:8000
good luck.
@hind77, your app.php change is unnecessary as it just uses the APP_URL value. Also, http://localhost:8000 should work just fine as well. Your issue was most likely the missing port, rather than localhost vs 127.0.0.1
@fletch3555 yeah i agree its the same thing the port is the prob i just wrote what did so adding the port is enough
This issue has been automatically locked since there has not been any recent activity after it was closed. If you have further questions please ask in our Slack group.
Most helpful comment
I had the same issues last time, but I did that way. Can you try built in server:
php artisan serveand adjust the .env:
APP_URL=http://localhost:8000