jeudi 23 juin 2016

How do you include a global class in laravel

I would like to include a class for every controller to use. Here is what I tried with no luck.

In the Controller.php file, I added this line of code:

use App\Lib\RequestType;

Then in my controller UserController.php, I called a test function.

dd(RequestType::test());

But a fatal error is thrown.

Class 'App\Http\Controllers\RequestType' not found

What is laravel looking for the class in the Controllers folder. Shouldn't UserController inherit the Controller class?

Thanks in advance



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire