To make global helpers, you can do it like so.
Add a php file (not class) to the following the following path app/Helpers/helper.php.
if (! function_exists('helper')) {
function helper() {
return new Helper();
}
}
To make it similar to Laravels, the approach is to make an object you can call methods on the initial helper call will return.
class Helper {
public function getHelp() {
return 'did this help?';
}
}
Now get composer to autoload your file with the helper function.
"autoload": {
"files": [
"app/Helpers/helper.php"
]
}
This will enable you to call the following.
helper()->getHelp(); // returns: did this help?
For your last question.
Is is wise to make some helper like that?
In object oriented design this is an anti pattern as it deals with global functions and should be either static namespaced calls or objects. However in the context of Laravel i really enjoy what you can do with these helpers and right now, in my current project, we have global functions dealing with formatting floats to our locale money string representation that have helped a lot and is very pleasant to use.