Skip to content

Commit

Permalink
Merge pull request #28 from YonesSaeedi/patch-5
Browse files Browse the repository at this point in the history
Create ServiceProviderLaravel8.php Support Laravel8
  • Loading branch information
hosseinRezaei188 authored Sep 30, 2020
2 parents 341c67e + 81aab43 commit 4924bce
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions src/ServiceProviderLaravel8.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php

namespace Kavenegar\Laravel;

use Kavenegar\KavenegarApi as KavenegarApi;

class ServiceProviderLaravel8 extends \Illuminate\Support\ServiceProvider
{
/**
* Bootstrap the application events.
*
* @return void
*/
public function boot()
{
$this->publishes([__DIR__ . '/config/config.php' => config_path('kavenegar.php')]);
}
/**
* Register the service provider.
*
* @return void
*/
public function register()
{
$this->mergeConfigFrom(__DIR__ . '/config/config.php', 'kavenegar');
$this->app->singleton('kavenegar', function ($app) {
return new KavenegarApi($app['config']->get('kavenegar.apikey'));
});
}
}

0 comments on commit 4924bce

Please sign in to comment.