Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install/usage help #146

Open
polycode-nz opened this issue Jul 31, 2023 · 2 comments
Open

Install/usage help #146

polycode-nz opened this issue Jul 31, 2023 · 2 comments

Comments

@polycode-nz
Copy link

New to Laravel.. Is there anything else I need to do to install/use this?

I installed it with: composer require laravolt/avatar

Only way I seem to be able to use it is with:

use Laravolt\Avatar\Avatar; .... $avatar = new Avatar(['theme' => 'colorful']); return $avatar->create('some name')->toBase64();

Which is the docs for non-Laravel projects. Is there some auto-discover/facade things I'm missing?

Even though the above works it doesn't seem right and only outputs grey scale.

@michaelstaake
Copy link

michaelstaake commented Oct 12, 2023

I'm having a similar issue. Avatar:: works perfectly in web.php and in blade templates. However, attempting to use it elsewhere such as in Requests or Controllers with "use Laravolt\Avatar\Avatar" at the top results in this error:
"Non-static method Laravolt\Avatar\Avatar::create() cannot be called statically". If I remove "use Laravolt\Avatar\Avatar" it just says "class something\Avatar not found"

@Marcel-Sass
Copy link

you can use \Avatar::create because a alias is created.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants