I have created a class in AppHelpersIdTransformer
theres just two functions there.
I have registered it in aliases array in my app.php
in configapp
'aliases' => Facade::defaultAliases()->merge([
// 'Example' => AppFacadesExample::class,
'IdTransformer' => AppHelpersIdTransformer::class,
])->toArray(),
then i do, php artisan config:clear
and php artisan config:cache
i can successfully access the file, in my code, but the Intelephense cannot find it.
and it is so annoying.
what must i do?
2
Answers
What i did to solve this is,
I just put this line in the
composer.json
then i run
composer dump-autoload
If you want to use your favorite helper file in Laravel programs, you should put it in the composer.json file and provide autoload, please pay attention to the example below:
Add the following presentation to the ./composer.json file and in the autoload section:
At the end type the following command:
In any part of your Laravel application, you can use the functions in IdTransformer.php as follows:
At the same time, hit the command