laravolt/avatar

Install/usage help

Closed this issue · 2 comments

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.

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"

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