I would like to create helper functions to avoid repeating code between views in Laravel 5:
view.blade.php
Foo Formated text: {{ fo
instead of including your custom helper class, you can actually add to your config/app.php
file under aliases.
should be look like this.
'aliases' => [
...
...
'Helper' => App\Http\Services\Helper::class,
]
and then to your Controller, include the Helper using the method 'use Helper' so you can simply call some of the method on your Helper class.
eg. Helper::some_function();
or in resources view you can directly call the Helper class already.
eg. {{Helper::foo()}}
But this is still the developer coding style approach to be followed. We may have different way of solving problems, and i just want to share what i have too for beginners.