Laravel 8, PHP 8.0
here is helper function autoload array in package composer.json
"autoload": {
"psr-4": {
"Chatify\\": "src/"
},
"files": [
"src/helper.php"
]
},
But When I try to call helper by any of its function inside blade file or in the controller its did not detect it. Its only detect the Application helper file.
I have trid these command composer dumpautoload and composer update, but it did not help.
I am trying to create a helper function for my custom package. I dont want to use Laravel Application Helper Function.
>Solution :
Its Already Solved here
Creating a custom helper in own package in laravel
Could not solve it by composer independently and used my package service provider. I added this code to the boot() method of my FaviconServiceProvider and it works now:
if (File::exists(__DIR__ . '\app\helpers.php')) {
require __DIR__ . '\app\helpers.php';
}