Paypal Standard re-factoring

This commit is contained in:
cuneytsenturk
2018-12-18 13:02:40 +03:00
parent df5eb71cbb
commit a1756a6219
26 changed files with 42 additions and 87 deletions

View File

@ -3,10 +3,9 @@
namespace Modules\PaypalStandard\Providers;
use Illuminate\Support\ServiceProvider;
use Illuminate\Database\Eloquent\Factory;
use App\Events\PaymentGatewayListing;
use Modules\PaypalStandard\Events\Handlers\PaypalStandardGateway;
use Modules\PaypalStandard\Listeners\PaypalStandardGateway;
class PaypalStandardServiceProvider extends ServiceProvider
{
@ -25,13 +24,10 @@ class PaypalStandardServiceProvider extends ServiceProvider
public function boot()
{
$this->registerTranslations();
$this->registerConfig();
$this->registerViews();
$this->registerFactories();
$this->registerMigrations();
$this->loadMigrationsFrom(__DIR__ . '/../Database/Migrations');
$this->app['events']->listen(PaymentGatewayListing::class, PaypalStandardGateway::class);
$this->registerEvents();
}
/**
@ -44,22 +40,6 @@ class PaypalStandardServiceProvider extends ServiceProvider
//
}
/**
* Register config.
*
* @return void
*/
protected function registerConfig()
{
$this->publishes([
__DIR__.'/../Config/config.php' => config_path('paypalstandard.php'),
], 'config');
$this->mergeConfigFrom(
__DIR__.'/../Config/config.php', 'paypalstandard'
);
}
/**
* Register views.
*
@ -96,15 +76,14 @@ class PaypalStandardServiceProvider extends ServiceProvider
}
}
/**
* Register an additional directory of factories.
* @source https://github.com/sebastiaanluca/laravel-resource-flow/blob/develop/src/Modules/ModuleServiceProvider.php#L66
*/
public function registerFactories()
public function registerMigrations()
{
if (! app()->environment('production')) {
app(Factory::class)->load(__DIR__ . '/Database/factories');
}
$this->loadMigrationsFrom(__DIR__ . '/../Database/Migrations');
}
public function registerEvents()
{
$this->app['events']->listen(PaymentGatewayListing::class, PaypalStandardGateway::class);
}
/**