Level 73
Try clearing the cache in case that's the issue:
php artisan config:clear
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
In my Laravel project, I am trying to use a custom helper:
namespace App\Http\Helpers;
class AppHelper
{
public static function toAlphabet($integer){
$alphabet = array('A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z');
$alpha_flip = array_flip($alphabet);
if($integer <= 25){
return $alphabet[$integer];
}
elseif($integer > 25){
$dividend = ($integer + 1);
$alpha = '';
$modulo;
while ($dividend > 0){
$modulo = ($dividend - 1) % 26;
$alpha = $alphabet[$modulo] . $alpha;
$dividend = floor((($dividend - $modulo) / 26));
}
return $alpha;
}
}
}
In my config/app.php
I have:
'aliases' => [
'AppHelper' => App\Http\Helpers\AppHelper::class,
];
View
<td>
{{AppHelper::toAlphabet($employee->employee_id)}}
</td>
But when I rendered the view page I got this error:
Class 'AppHelper' not found
How do I resolve this?
Thanks
Try clearing the cache in case that's the issue:
php artisan config:clear
Please or to participate in this conversation.