samedi 23 juillet 2016

Laravel 5.2 namespaces

I am struggling with namespacing in laravel. I have a standard folder structure for a project after doing laravel new. I added a folder called dataaccess in the app folder so I put all my data access classes in so it has the following structure:

projectdir>app>dataaccess>dataaccessclasses(files)

and all my dataaccess classes have the namespace App at the top of every class ( I did this just to make things simple). Now in my controller I add this to the top so I can use my dataaccess classes:

<?php use App; ?>

But Laravel tells me that it cannot locate my dataaccess class and tries to resolve it relative to the namespace of the controller. Here is the error it spits at me:

ReflectionException in Container.php line 794: Class App\Http\Controllers\StockDataAccess does not exist.

can any one shed any light on what all this means?



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2akh96o
via IFTTT

Aucun commentaire:

Enregistrer un commentaire