Hi, I have service provier:
class TwitterServiceProvider extends ServiceProvider {
public function register()
{
$this->app->bind('Libraries\Wrappers\SocialApi\Twitter', function() {
return new CacheSocialApiDecorator(new Twitter());
});
}
}
How would I this inject into controller? My attempt is like this:
use Libraries\Wrappers\SocialApi\Twitter;
class TeamController extends BaseController {
protected $twitterApi;
public function __construct(Twitter $twitterApi)
{
$this->twitterApi = $twitterApi;
}
}
What am I missing? What is best solution?
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community