// 1- Create a helper file
//Go to app/ directory and create a file called helpers.php
// 2- Write the helper function
// 3- Include it in our composer.json
"autoload": {
"psr-4": {
"App": "app/",
"DatabaseFactories": "database/factories/",
"DatabaseSeeders": "database/seeders/"
},
"files": [
"app/helpers.php"
]
},
// 4- Regenerate the list of all classes in the app
$ composer dump-autoload