|
@@ -21,17 +21,15 @@
|
|
*/
|
|
*/
|
|
|
|
|
|
use App\Billing\Stripe;
|
|
use App\Billing\Stripe;
|
|
|
|
+use App\Providers\AppServiceProvider;
|
|
|
|
|
|
-// Use singleton() instead to obtain a reused instance.
|
|
|
|
-// Use instance(Stripe::class, $stripe) to replace the instance with another object.
|
|
|
|
-App::bind(Stripe::class, function () {
|
|
|
|
- return new Stripe(config('services.stripe.key'));
|
|
|
|
-});
|
|
|
|
|
|
+// Can use either the class name or a readable service name, thanks to aliasing.
|
|
|
|
+$stripe = App::make(AppServiceProvider::STRIPE);
|
|
|
|
+$stripeAgain = app(AppServiceProvider::STRIPE);
|
|
|
|
|
|
-$stripe = App::make(Stripe::class);
|
|
|
|
-$stripeAgain = app(Stripe::class);
|
|
|
|
$stripeAlso = resolve(Stripe::class);
|
|
$stripeAlso = resolve(Stripe::class);
|
|
$stripeToo = app()->make(Stripe::class);
|
|
$stripeToo = app()->make(Stripe::class);
|
|
|
|
+
|
|
dd($stripe, $stripeAgain, $stripeAlso, $stripeToo);
|
|
dd($stripe, $stripeAgain, $stripeAlso, $stripeToo);
|
|
|
|
|
|
/** @var \Illuminate\Routing\Router $this */
|
|
/** @var \Illuminate\Routing\Router $this */
|