mitchellvanw / laravel-doctrine

NO LONGER MAINTAINED! A Doctrine 2 implementation that melts with Laravel
MIT License
187 stars 74 forks source link

ReflectionException Class auth does not exist #2

Closed abbajbryant closed 10 years ago

abbajbryant commented 10 years ago

When using a namespaced app and injecting the entityManager into an abstract base controller. I have a route pointed to a Crunch\Controller\PageController@homePage that does nothing but echo "homepage" in it's action.

http://laravel.io/bin/1bGkv for all of the relevant code. Can you point out what is going wrong with this for me? The doctrine commands work on a user model using the Authentication trait.

From the whoops error stack it appears it's happening here:

/mitch/laravel-doctrine/src/LaravelDoctrineServiceProvider.php on line 94

mitchellvanw commented 10 years ago

The metadata values have to be folders, not an entity nor class. Try this and let me know if it worked.

'metadata' => [
    base_path('app/Crunch')
],
mitchellvanw commented 10 years ago

@abbajbryant what Laravel version are you running?

abbajbryant commented 10 years ago

That is the path, not a namespace. I have all of my entities in the app/Crunch/Entity folder and namespaced as such.

I am running 4.1.*

mitchellvanw commented 10 years ago

@abbajbryant I've pushed a little change which might fix it, please do a composer update and get the latest changes

abbajbryant commented 10 years ago

It isn't going away - when I check the app object in the service provider I see that the auth key isn't in the list of service providers and that it appears that the auth service provider is not in the resolved list of providers yet.

the dd output http://laravel.io/bin/2z4N1

mitchellvanw commented 10 years ago

I'm following the exact steps as described in the laravel documentation. Did you set the auth.php driver value to doctrine. Possibly made a typo somewhere? Could you repaste everything?

abbajbryant commented 10 years ago

I shared the repo on bitbucket (using the address in your profile here) - it might be easier than digging through a pastebin. The repo is really basic.

mitchellvanw commented 10 years ago

@abbajbryant I can't seem to find the repo. Could you paste the link to it

abbajbryant commented 10 years ago

https://bitbucket.org/abbajbryant/crunch

It isn't public - I sent an invite to mitchell@kooding.nl - you might have to click a link to confirm it.

abbajbryant commented 10 years ago

Gave you write access.

mitchellvanw commented 10 years ago

@abbajbryant I managed to replicated your exact error. I'll try and figure out the solution

abbajbryant commented 10 years ago

thanks

paolooo commented 9 years ago

+1 Got the same error. I'm using Laravel 4.2.*...

The error starts on "extendAuthManager()" function.

https://github.com/mitchellvanw/laravel-doctrine/blob/master/src/LaravelDoctrineServiceProvider.php#L116