I wrote a simple helper class, placed it in app\Helpers\MyHelper.php and created an alias for it in the app.php configuration file:
'MyHelper' => App\Helpers\MyHelper::class,
The problem is that, now I need to use the class constructor to initialize some default values in it. However, the __construct function will never get called. Obviously, since it never gets initialized.
The question is, how (or where) can I initialize the helper class properly, so it could initialize it's default values?
My first thought: AppServiceProvider.php file and the boot() function.
I have placed a new MyHelper(); line there and it's working, however I'm wondering if this is a proper way doing it?