Skip to content
This repository has been archived by the owner on Jan 10, 2020. It is now read-only.

JWT - Class App\Repositories\User\User::class does not exist #86

Closed
mistre83 opened this issue Oct 6, 2016 · 3 comments
Closed

JWT - Class App\Repositories\User\User::class does not exist #86

mistre83 opened this issue Oct 6, 2016 · 3 comments

Comments

@mistre83
Copy link

mistre83 commented Oct 6, 2016

Hi,
i've setup Laracogs for my project and i'm already using it.
Now, i would like to create some API (right now, i have used just web routing).

So, i have moved my route in routes/api.php (because is an AJAX call).
When i call this (jquery, with $.ajax POST) i get the error:

Class App\Repositories\User\User::class does not exist

I have follow the guide on how setup Laracogs for API (JWT) and i have also changed the class in 'user' => '\App\Repositories\User\User::class', inside jwt.php

@mlantz
Copy link
Member

mlantz commented Oct 6, 2016

Opps seems like my docs are out of date, it needs to be App\Models\User::class

@mistre83
Copy link
Author

mistre83 commented Oct 6, 2016

Mhhh ok documentation should be updated because Repository no longer exists :)
However... i'm already using the version with repositories... for this i have used \App\Repositories\User\User::class

I have this class and the path is ok. I have already do dump-autoload but nothing...

@mlantz
Copy link
Member

mlantz commented Oct 6, 2016

ohh I see the issue:'user' => '\App\Repositories\User\User::class' is incorrect PHP you need to do: user' => \App\Repositories\User\User::class the ::class tells PHP to treat the class name as a string on its own but when you wrap it in a string it tells PHP to use the whole class as a string which doesnt work.

@mlantz mlantz closed this as completed Oct 6, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants