-
Notifications
You must be signed in to change notification settings - Fork 784
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Trying to get property of non-object in ClientRepository.php (line 80) #406
Comments
Which version of Passport are you using? |
I'm having the same issue, exactly the way you describe (also how to fix it), but to me, it says its on line #81. I'm on version ^3.0 |
Please can you paste some stack traces as there just isn't enough information to go on here |
I had the same issue when i upgraded to ^3.0. I ran |
Hello @alexbilbie I apologize for the delay in providing more info, below is a stack trace from the log. I believe this is just an error caused by the lack of the pre-requirement To replicate the error, start a new laravel project, add passport on composer, and on
|
Based on Laracasts discussion channel, you need to create a personal access token : |
@lonewolfffffff thanks, this is what worked with me, it used to work normally on localhost then when published this happened, so I created a personal access token, it wasn't about an issue with passport prerequisites, thanks a lot! |
I had the same issue today, stumped me for quite a while before I found this GitHub issue. Shouldn't this case be caught and show a special error instead of this super vague error? I bet a lot of people wasted time on this. A generating the token is a requirement, then test for the requirement ;) |
I'm having the same issue, but creating personal access client didn't solve it for me. |
Unfortunately same with @nospoon. So far tried removing |
Actually, my issue turned out to be the fact I was running it in test environment, which didn't have the personal access client in it. Adding the command to add the client to my test's setUp method solved the issue. |
First verify whether "oauth_clients" table is empty, If there is no row in that table, Run this command in your command line: php artisan passport:install |
the following commands solved my problem: 2- php artisan passport install |
|
The command
My run method contains the following:
Don't forget to add: |
TL;DR> Call the I would personally object to storing secrets like that in a Seeder. Not only would you enter a key into a source repository, but the developers that use the code will not know that they should 'Change All The Keys'. Having Passport (or Laravel) complain or otherwise bork is a generally a good idea, because it forces a developer to generate new certificates, clients and secrets. If you really, really want to have a fresh set of keys, clients and secrets, everytime you do a <?php
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\Artisan;
class OAuthSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
Artisan::call('passport:install');
}
} |
Please use the install instructions. They'll guide you through the process of having a personal client in your DB. A PR was also merged recently which will make this error more clear. |
After some time when trying to create personal access token using vue components, it throws Trying to get property of non-object in ClientRepository.php (line 80)
It works normal again after running the command php artisan passport:install
But if I run php artisan migrate:refresh , again got into the same issue..
The text was updated successfully, but these errors were encountered: