93 - Wiring It All Together

This commit is contained in:
Adam Wathan
2017-04-01 14:09:54 -04:00
parent 6023eb3c8f
commit e3f337f377
4 changed files with 10 additions and 1 deletions

View File

@@ -2,7 +2,9 @@
namespace App\Providers;
use App\TicketCodeGenerator;
use App\Billing\PaymentGateway;
use App\HashidsTicketCodeGenerator;
use App\Billing\StripePaymentGateway;
use Illuminate\Support\ServiceProvider;
use App\OrderConfirmationNumberGenerator;
@@ -31,7 +33,12 @@ class AppServiceProvider extends ServiceProvider
return new StripePaymentGateway(config('services.stripe.secret'));
});
$this->app->bind(HashidsTicketCodeGenerator::class, function () {
return new HashidsTicketCodeGenerator(config('app.ticket_code_salt'));
});
$this->app->bind(PaymentGateway::class, StripePaymentGateway::class);
$this->app->bind(OrderConfirmationNumberGenerator::class, RandomOrderConfirmationNumberGenerator::class);
$this->app->bind(TicketCodeGenerator::class, HashidsTicketCodeGenerator::class);
}
}