skip to Main Content

I’ve recently set up a new Laravel 5.5 project on Ubuntu 16.04 with an NGINX server. I’ve followed all the correct steps and double checked everything more than once. I’ve installed Laravel/Passport and double checked those set up instructions as well.

I’m building an API that requires a login for most endpoints, which is done via password_grant with laravel/passport but can also consumes a Facebook auth token – instead of writing my own Facebook Auth Token verify, I’ve chosen to use a larval plugin. composer require danjdewhurst/laravel-passport-facebook-login However, this plugin doesn’t seem to install easily for me.

I am receiving an error on any composer install or update command I issue:

Target [LeagueOAuth2ServerRepositoriesClientRepositoryInterface] is not instantiable while building [LeagueOAuth2ServerAuthorizationServer].

I have played around with the config/app.php file as well as the uses for all of the files and providers that were installed with the plugin. I have gone through every post here to try and fix the issue as well.

If anyone has any insight or a fix for this issue I’d appreciate it. Any help would help.

Thank you.

3

Answers


  1. I was trying to composer update and encounter the same problem.

    Then I notice the dependencies in https://github.com/danjdewhurst/Laravel-Passport-Facebook-Login stated

    "laravel/passport": "^4.0",
    

    I solved my problem after updating my passport

    Login or Signup to reply.
  2. I found this to be an issue with the order of Laravel’s auto discovery of packages. Obviously the Facebook Grant package needs to load after laravel/passport but this was not happening.

    My solution was to add the following to my composer.json:

    "extra": {
        "laravel": {
            "dont-discover": [
                "laravel/passport",
                "danjdewhurst/laravel-passport-facebook-login"
            ]
        }
    }
    

    and then the following to my config/app.php in the providers array:

    LaravelPassportPassportServiceProvider::class,
    DanjdewhurstPassportFacebookLoginFacebookLoginGrantProvider::class,
    
    Login or Signup to reply.
  3. After adding LaravelPassportServiceProvider::class to config/app.php providers. I just deleted the .php from bootstrap/cache/ and it works.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search