I've created a library
folder within the app
folder to add my own classes.
This is the content of the file app/library/helper.php
:
<?php
namespace Library;
class MyHelper
{
public function v($arr)
{
var_dump($arr);
}
}
I added the namespace to composer.json
:
and then I ran
$ composer dump-autoload
but it does not seem to have any effects.
The files
vendor/composer/autoload_psr4.php
vendor/composer/autoload_classmap.php
did not change.
If I try to create an instance of MyHelper
, Laravel reports the following error:
I'm not sure what I am doing wrong.
App\Library
. – Spin