joshstaff
3 years ago

IOC Container error message

Posted 3 years ago by joshstaff

I'm attempting to integrate to the Xero API - I'm using the following wrapper:

https://github.com/drawmyattention/xerolaravel

I'm able to access the API with the Facade methods but I would really like to resolve the dependencies and do it all properly, I'm still learning these bits.

I have followed the instructions, added:

DrawMyAttention\XeroLaravel\Providers\XeroServiceProvider::class

To my app.php & inside of my Controller I am attempting to resolve this (I think?)

I begin by doing the following:

use DrawMyAttention\XeroLaravel\Providers\XeroServiceProvider as Xero;
    private $xero;


public function __construct(XeroServiceProvider $xero)
{
    $this->xero = $xero;
}

And even that, produces the error:

 BindingResolutionException in Container.php line 828:
 Unresolvable dependency resolving [Parameter #0 [ <required> $app ]] 
 in class Illuminate\Support\ServiceProvider

I'm really sorry if this is a stupid question - I haven't dabbled much into this side of Laravel.

Please sign in or create an account to participate in this conversation.