• 1000
это мой код
$image = asset('storage/certificates/'.$tutorial_set_premium->image_certificate);
$createimage = imagecreatefrompng($image);
/**
* algorithm create random name
*/
$length = 15;
$random = '';
for ($i = 0; $i < $length; $i++) {
$random .= rand(0, 1) ? rand(0, 9) : chr(rand(ord('a'), ord('z')));
}
$certificate_name = 'SK-'.Str::upper($random);
$output = 'SK-'.Str::upper($random).'.png';
//then we make use of the imagecolorallocate inbuilt php function which i used to set color to the text we are displaying on the image in RGB format
$white = imagecolorallocate($createimage, 205, 245, 255);
$black = imagecolorallocate($createimage, 0, 0, 0);
//Then we make use of the angle since we will also make use of it when calling the imagettftext function below
$rotation = 0;
//we then set the x and y axis to fix the position of our text name
$origin_x = 500;
$origin_y=1350;
//font directory for name
$drFont = realpath('assets/certificate/developer.ttf');
// font directory for occupation name
$drFont1 = realpath('assets/certificate/developer.ttf');
//check lenght name
$name = auth()->user()->name;
//function to display name on certificate picture
$text1 = imagettftext($createimage, 130, $rotation, $origin_x, $origin_y, $black, $drFont, $name);
imagepng($createimage,$output,3);
Storage::putFileAs('public/generate_certificates', $output, $output);
File::delete($output);
return redirect()->route('public.home.certificate')->with(['no_certificate' => $certificate_name]);
это моя ошибка исключения:
введите описание изображения здесь