1
gefunden zu
ich meine eigenen Serviceprovider erstellen param Form ENV als Initiations Klasse senden:Methode nicht
class InstagramServiceProvider extends ServiceProvider
{
protected $defer = true;
public function boot()
{
$this->publishes([
__DIR__.'/../config/config.php' => config_path('instagram.php'),
]);
}
public function register()
{
$this->app->bind('instagram.client', function ($app) {
return new InstagramClient([
'apiKey' => $app['config']->get('instagram.clientId'),
'apiSecret' => $app['config']->get('instagram.clientSecret'),
'apiCallback' => $app['config']->get('instagram.redirectUri'),
'scope' => $app['config']->get('instagram.scope'),
]);
});
}
public function provides()
{
return array('instagram.client');
}
}
Und ich kann nicht Daten von Config? Was ich falsch mache?
Sie könnten auch '$ app [verwenden‘
Alternativ Sie eine Klammer-Notation wie so verwenden könnte config '] [' instagram '] [' clientId '] 'usw. – Neat
Ahh, toller! Ich füge das hinzu. :-) –