التشغيل مع مزودي الخدمة:
إنشاء مزود
php artisan make:provider PaymentServiceProviderدالة Register
public function register()
{
$this->app->singleton(PaymentGateway::class, function ($app) {
return new StripeGateway(config('services.stripe.key'));
});
}دالة Boot
public function boot()
{
View::composer('*', function ($view) {
$view->with('settings', Settings::all());
});
}التسجيل في Config
'providers' => [
App\Providers\PaymentServiceProvider::class,
],