0

Controller File:

use Image;

if ($request->file('dp')) {
        $image = $request->file('dp');
        $img_name = hexdec(uniqid('', true)).'.'.$image->getClientOriginalExtension();
        Image::make($image)->resize(150,150)->save('upload/employee_Img/'.$img_name);
        $image_path = 'upload/employee_Img/'.$img_name;
    }

Employees::insert([
        'dp' => $image_path,
        'created_at' => Carbon::now()
    ]);

It was returning an error saying -- GD Library extension not available with this PHP installation.

Wakil Ahmed
  • 1,053
  • 1
  • 8
  • 16

1 Answers1

0

Go to XAMPP control panel. Then press the config button on beside apache start button. From there go to php.ini file. Then search for gd or gd2 and remove the quatation before the following line - ;extension=gd -> extension=gd.

Restart the apache and mysql server and you're good to go.

[find the php.ini file here][1]

Wakil Ahmed
  • 1,053
  • 1
  • 8
  • 16
  • in my php.ini "extension=gd2" was already uncommented, also i see via "phpinfo()" that gd2 is enabled, still i get this warning "GD Library extension not available with this PHP installation" – Ben jamin Sep 06 '22 at 05:57