Class 'Helper' not found in laravel code example
Example: error class helper not found laravel
Step 1: Create your Helpers (or other custom class) file and give it a matching
namespace. Write your class and method:
<?php
namespace App\Helpers;
class Helper
{
public static function shout(string $string)
{
return strtoupper($string);
}
}
-----------------------------------------
Step 2: Code within config/app.php
<?php
'aliases' => [
...
'Helper' => App\Helpers\Helper::class,
...
---------------------------------------------
Step 3:
<!-- Code where you want to use Helper class -->
{!! Helper::shout('this is how to use autoloading correctly!!') !!}
reference :
https: