Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Call to undefined function App\Http\Controllers\imageloadfont()

Why does the php function imageloadfont not working on php version 8 and laravel 9

Is there a new way to call php built-in functions inside laravel controllers?

namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Session\Store;
use Illuminate\Support\Facades\Session;

class CaptchaController extends Controller{
    public function createCaptcha() {
        $font = imageloadfont(asset('public/captcha/04b.gdf'));

It produces an error

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Call to undefined function App\Http\Controllers\imageloadfont()

>Solution :

Stick a backslash in front: \imageloadfont(asset('public/captcha/04b.gdf'));

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading