avatar icon indicating copy to clipboard operation
avatar copied to clipboard

Install/usage help

Open polycode-nz opened this issue 1 year ago • 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.

polycode-nz avatar Jul 31 '23 01:07 polycode-nz

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"

michaelstaake avatar Oct 12 '23 18:10 michaelstaake

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

Marcel-Sass avatar Dec 14 '23 14:12 Marcel-Sass