composer require jestevezrod/initar
This package allows you to create and assign in a very easy way the default avatar profile for your users using their name and lastname initials.
Once installed you have to add the trait to your User model:
use \Jestevezrod\Initar\Traits\HasInitar;
class User extends Authenticatable
{
use HasApiTokens, HasFactory, Notifiable, HasInitar;
If for some reason you don't have the initar.php config file, you can create it running:
php artisan vendor:publish
You should modify the config file to make the package works as you desire. For instance you can add a list of colors to be used as background color of the avatar.
Author: Jesus Estevez