Home > OS >  Call to undefined function App\Http\Controllers\imageloadfont()
Call to undefined function App\Http\Controllers\imageloadfont()

Time:11-15

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

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

CodePudding user response:

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

  • Related