12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- <?php
- namespace App\Providers;
- use App\Billing\Stripe;
- use App\Post;
- use Illuminate\Foundation\Application;
- use Illuminate\Support\ServiceProvider;
- class AppServiceProvider extends ServiceProvider
- {
- const STRIPE = 'billing.stripe';
- const STRIPE_KEY = 'services.stripe.key';
- protected $defer = true;
-
- public function boot()
- {
- view()->composer('layouts.sidebar', function ($view) {
- $view->with('archives', Post::archives());
- });
- }
-
- public function register()
- {
-
-
- $app2 = $this->app;
- $this->app->bind(Stripe::class, function (Application $app) use($app2) {
-
- return new Stripe($this->app['config'][static::STRIPE_KEY]);
- });
- $this->app->alias(Stripe::class, static::STRIPE);
- }
- }
|