
As you guys can see, the key 'user' in config/jwt.php file is commented, but everything is fine. I'm still doing login and logout. In other times peoples would find me thanking god for everything is working fine. But i need to change this user for another class and it does not metter with App\User, App\Client, 1234\Bill\4321 or App!@藛&#!@*, nothing works.
could anyone help me?
I'm using Laravel 5.1.
hey there.. i think, if you comment something out from the config, laravel retrieves the config file from the vendor folder instead.. the files in config only overwrite values in vendor..
@johannesschobel , Thank you for you help. I'm looking throughout for any solutions and i can't find anything but other peoples having the same problem: Even if i change the user key for another table different of \App\User, the JWT::attempt method still remains using the \App\User table.
After many days looking for a solution for this issue on web, i just find now by myself the reason for that not working as the Tymon's documentation says and we expected. The problem starts on vendor/tymon/jwt-auth/src/JWTAuth.php file, at the attempt method.

Giving a rapid look, we can see on if statement the $this->auth->byCredentials($cretendials). Giving a cmd + click on byCredentials, we will be pointed to an AuthInterface's method which is implemented on vendor/tymon/jwt-auth/src/Providers/Auth/IlluminateAuthAdapter.php file.

Another rapid look to the method byCredentials, we see $this->auth->once($credentials); This auth is the Laravel native AuthManager which uses the config/auth.php file. Here is the problem! this Methods will always uses the 'model' key on config/auth.php which has as value the class \App\User. I tried to change the value for other table and... Bang! i received the token.
It's a huge problem. I have a feeling that it can be solved using another lib to implements MultiAuth on Laravel. It could be more easy if the owner answer his issues.
Hey @arturcesarmelo ,
glad you solved the issue.
Actually, i do not think, that this is a huge problem as you said. Reading the docblock from the /config/auth.php it is quite clear:
/*
|--------------------------------------------------------------------------
| User Providers
|--------------------------------------------------------------------------
|
| All authentication drivers have a user provider. This defines how the
| users are actually retrieved out of your database or other storage
| mechanisms used by this application to persist your user's data.
|
| If you have multiple user tables or models you may configure multiple
| sources which represent each model / table. These sources may then
| be assigned to any extra authentication guards you have defined.
|
| Supported: "database", "eloquent"
|
*/
However, you are right - it could be mentioned within the doc of tymon/jwt that one may need to change the config in /config/auth.php as well.
@johannesschobel, thank you one more for your concern. But as i said before, i'm using Laravel 5.1. This version does not support multiple tables as the latest version do. So i guess that jwt-auth does not give support for multiple tables to any Laravel version over then 5.0 as this repository composer suggest.
There's no way to solve that. It must be set a minimum Laravel version. I tried in vain to implement multi authentication in my project but i forgot about the ServiceContainer into vendor/Tymon. It tries to inject a Illuminate\Auth\AuthMenager and with the MultiAuth, this class change. It's impossible without a PR to adapter this.
just to be sure - who do you directly address with this "fu**cking guy"?
holy shit.. that is quite rude..
This is, however, not acceptible at at all. @tymondesigns works hard and provides an awesome package for free, the community (including me) tries to solve YOUR problems, and you start insulting the package owner..
"I have been working 16h" is not an excuse for this behaviour..
@arturcesarmelo I saw the original comments before you removed them. I hope that means you realised what you said and how disrespectful it was.
Coming on here and acting entitled WON'T get you the support you want (not from me anyway). And also sending me a friendly worded email asking for help whilst referring to me as "this f**king guy" won't get you anywhere.
Anyways you might want to give this a read also https://github.com/tymondesigns/jwt-auth/blob/develop/CODE_OF_CONDUCT.md
@johannesschobel Thanks for calling that out buddy 馃憤
haha, it gets even funnier, when reading the e-mail part..
no problem ;)
@tymondesigns, Yes, i realised how awful was my comments before. As a said before, i stated work at 8pm on a day, finishing about 5:30am a day after. Wasn't at my perfect mind. One more time: I'm sorry about that.
After find the problem, i call my supervisor and he told me about adapter pattern on Laravel. After know about that, was easy to solve the problem.
@johannesschobel, Thank you for makes me realised and i'm sorry to you too. I hope a day we put all those bullshit that i spoke under the bridge.
@arturcesarmelo That's great, it's water under the bridge..
it's not good for anyone to burn themselves out doing this stuff.. take time out, it helps!
I'll close this then since you have your solution
Most helpful comment
There's no way to solve that. It must be set a minimum Laravel version. I tried in vain to implement multi authentication in my project but i forgot about the ServiceContainer into vendor/Tymon. It tries to inject a Illuminate\Auth\AuthMenager and with the MultiAuth, this class change. It's impossible without a PR to adapter this.