I would like to create helper functions to avoid repeating code between views in Laravel 5:
view.blade.php
Foo Formated text: {{ fo
First create helpers.php inside App\Http directory. Then add the following code inside the composer.json
"autoload": {
"classmap": [
"database"
],
"files": [
"app/Http/helpers.php"
],
"psr-4": {
"App\\": "app/"
}
},
Next run the following command
composer dump-autoload
Now you can define your custom function inside the helpers.php file.