Voyager: Default avatar is broken for new users

Created on 26 Jun 2018  路  18Comments  路  Source: the-control-group/voyager

Version information

  • Laravel: v5.6.26
  • Voyager: v1.1
  • PHP: 7.2

Description

When adding user to voyager, its default avatar is broken.

Steps To Reproduce

Steps to reproduce the behavior:

  1. Create a new Laravel project
  2. Install Voyager without dummy data
  3. Add authentication scaffolding for Laravel, using php artisan make:auth
  4. Register new user, say with email [email protected]
  5. Add admin privileges to this user using php artisan voyager:admin [email protected]
  6. Go to /admin with the user logged in
  7. The requested file /storage/users/default.png does not exist

Expected behavior

A default avatar picture should appear

Screenshots

voyager

Additional context

I don't know if it's important but I'm using homestead as my web server.

bug help wanted

Most helpful comment

I hear what you are both saying. But I believe Voyager should provide a default avatar picture when creating users without using the --with-dummy flag. If not, what's the point of providing a whole set of icons as well? To me that's an issue that needs to be solved.

All 18 comments

Can you verify whether the file exists at /storage/app/public/users/default.png?

If so, what about /public/storage/users/default.png?

None of them exists.

The default user icons are only installed during the voyager:install --with-dummy command.

Did you change de .env file? I've got a similar issue, I wasn't using the Homestead though. I had to change the APP_URL=localhost to APP_URL=127.0.0.1:8000 like the docs says.

I experienced the same issue but you better pick an other default avatar on internet or do your own 馃槃

Yeah we really should have a default avatar set even when not using --with-dummy.

Maybe use Gravatar as default?

Gravatar is the devil 馃槤
(@fbnlsr This is only a personal appreciation. I just don't like the fact that you share the same image everywhere. I prefer to setup my avatar from case to case...)

Why's that?

Change the APP_URL in .env file
APP_URL=http://voyager.test

@slckym that is just wrong.
The image just doesn't exist, and changing the app-url to voyager.test will break everything (at least for him)

I did change the URL in the .env file when I first set up my app.

I believe this is a problem related to Voyager, not my config.

Without installing with dummy data, you can manually set the path to your own default user icon in config/voyager.php
https://github.com/the-control-group/voyager/blob/1.1/publishable/config/voyager.php#L21

@fbnlsr, in Laravel any file inside storage/app/public folder is considered as dummy files. take a look at .gitignore in the mentioned path.

So, to me they are not considered as my project main files and it seems reasonable to not create that file with default voyager installation.

I hear what you are both saying. But I believe Voyager should provide a default avatar picture when creating users without using the --with-dummy flag. If not, what's the point of providing a whole set of icons as well? To me that's an issue that needs to be solved.

Agreed, and Voyager used to. It was accidentally moved, not intentionally

Change the APP_URL in .env file
APP_URL=http://voyager.test

solve my problem. i wonder why other people dont get this issue. haha thanks alot

Change the APP_URL in .env file
APP_URL=http://voyager.test

THAAAANK YOU DUD!

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

popica80 picture popica80  路  3Comments

wislem picture wislem  路  3Comments

craigb88 picture craigb88  路  3Comments

abacram picture abacram  路  3Comments

Nagendra1421 picture Nagendra1421  路  3Comments