Level 27
@msaad Why reinvent the wheel? If all you want is an image with the initials (or first letter) of the username check out: https://eu.ui-avatars.com/
1 like
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hello, Friends I Want To Generate a Custom Image From the First Letter of the Username.
I Search For it And Get The Following Code But It Can't Work For Me.
use Intervention\Image\Facades\Image;
$img = Image::make('/storage/media/user_img/default.png');
$img->text('HW', 125, 80, function ($font) {
$font->file(public_path('/fonts/font.ttf'));
$font->size(40);
$font->color('#fdf6e3');
$font->align('center');
$font->angle(45);
});
$filename = time() . '.' . 'jpg';
$img->resize(150, 150)->save('/storage/media/user_img/' . $filename);
The Error is:
Intervention\Image\Exception\NotReadableException
Image source not readable
config > app.php
'providers' => [
Intervention\Image\ImageServiceProvider::class,
],
'aliases' => [
'Image' => Intervention\Image\Facades\Image::class,
],
Plz, Help Me. Thanks
@msaad Why reinvent the wheel? If all you want is an image with the initials (or first letter) of the username check out: https://eu.ui-avatars.com/
Please or to participate in this conversation.