akaunting/modules/PaypalStandard/Providers/PaypalStandardServiceProvider.php

99 lines
2.1 KiB
PHP
Raw Normal View History

2017-11-20 17:28:15 +03:00
<?php
namespace Modules\PaypalStandard\Providers;
use Illuminate\Support\ServiceProvider;
use App\Events\PaymentGatewayListing;
2018-12-18 13:02:40 +03:00
use Modules\PaypalStandard\Listeners\PaypalStandardGateway;
2017-11-20 17:28:15 +03:00
class PaypalStandardServiceProvider extends ServiceProvider
{
/**
* Indicates if loading of the provider is deferred.
*
* @var bool
*/
protected $defer = false;
/**
* Boot the application events.
*
* @return void
*/
public function boot()
{
$this->registerTranslations();
$this->registerViews();
2018-12-18 13:02:40 +03:00
$this->registerMigrations();
2017-11-20 17:28:15 +03:00
2018-12-18 13:02:40 +03:00
$this->registerEvents();
2017-11-20 17:28:15 +03:00
}
/**
* Register the service provider.
*
* @return void
*/
public function register()
{
//
}
/**
* Register views.
*
* @return void
*/
public function registerViews()
{
$viewPath = resource_path('views/modules/paypalstandard');
$sourcePath = __DIR__.'/../Resources/views';
$this->publishes([
$sourcePath => $viewPath
]);
$this->loadViewsFrom(array_merge(array_map(function ($path) {
return $path . '/modules/paypalstandard';
}, \Config::get('view.paths')), [$sourcePath]), 'paypalstandard');
}
/**
* Register translations.
*
* @return void
*/
public function registerTranslations()
{
$langPath = resource_path('lang/modules/paypalstandard');
if (is_dir($langPath)) {
$this->loadTranslationsFrom($langPath, 'paypalstandard');
} else {
$this->loadTranslationsFrom(__DIR__ .'/../Resources/lang', 'paypalstandard');
}
}
2018-12-18 13:02:40 +03:00
public function registerMigrations()
2017-11-20 17:28:15 +03:00
{
2018-12-18 13:02:40 +03:00
$this->loadMigrationsFrom(__DIR__ . '/../Database/Migrations');
}
public function registerEvents()
{
$this->app['events']->listen(PaymentGatewayListing::class, PaypalStandardGateway::class);
2017-11-20 17:28:15 +03:00
}
/**
* Get the services provided by the provider.
*
* @return array
*/
public function provides()
{
return [];
}
}