refactor
This commit is contained in:
parent
f3986734fc
commit
2fe51b6550
@ -2,10 +2,9 @@
|
|||||||
|
|
||||||
namespace Modules\OfflinePayment\Listeners;
|
namespace Modules\OfflinePayment\Listeners;
|
||||||
|
|
||||||
use Auth;
|
|
||||||
use App\Events\AdminMenuCreated;
|
use App\Events\AdminMenuCreated;
|
||||||
|
|
||||||
class OfflinePaymentAdminMenu
|
class AdminMenu
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -16,7 +15,7 @@ class OfflinePaymentAdminMenu
|
|||||||
*/
|
*/
|
||||||
public function handle(AdminMenuCreated $event)
|
public function handle(AdminMenuCreated $event)
|
||||||
{
|
{
|
||||||
$user = Auth::user();
|
$user = auth()->user();
|
||||||
|
|
||||||
// Settings
|
// Settings
|
||||||
if ($user->can(['read-settings-settings', 'read-settings-categories', 'read-settings-currencies', 'read-settings-taxes'])) {
|
if ($user->can(['read-settings-settings', 'read-settings-categories', 'read-settings-currencies', 'read-settings-taxes'])) {
|
@ -4,7 +4,7 @@ namespace Modules\OfflinePayment\Listeners;
|
|||||||
|
|
||||||
use App\Events\PaymentGatewayListing;
|
use App\Events\PaymentGatewayListing;
|
||||||
|
|
||||||
class OfflinePaymentGateway
|
class Gateway
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Handle the event.
|
* Handle the event.
|
@ -2,13 +2,11 @@
|
|||||||
|
|
||||||
namespace Modules\OfflinePayment\Providers;
|
namespace Modules\OfflinePayment\Providers;
|
||||||
|
|
||||||
use Illuminate\Support\ServiceProvider;
|
|
||||||
|
|
||||||
use App\Events\AdminMenuCreated;
|
use App\Events\AdminMenuCreated;
|
||||||
use Modules\OfflinePayment\Listeners\OfflinePaymentAdminMenu;
|
|
||||||
|
|
||||||
use App\Events\PaymentGatewayListing;
|
use App\Events\PaymentGatewayListing;
|
||||||
use Modules\OfflinePayment\Listeners\OfflinePaymentGateway;
|
use Illuminate\Support\ServiceProvider;
|
||||||
|
use Modules\OfflinePayment\Listeners\AdminMenu;
|
||||||
|
use Modules\OfflinePayment\Listeners\Gateway;
|
||||||
|
|
||||||
class OfflinePaymentServiceProvider extends ServiceProvider
|
class OfflinePaymentServiceProvider extends ServiceProvider
|
||||||
{
|
{
|
||||||
@ -29,7 +27,6 @@ class OfflinePaymentServiceProvider extends ServiceProvider
|
|||||||
$this->registerTranslations();
|
$this->registerTranslations();
|
||||||
$this->registerViews();
|
$this->registerViews();
|
||||||
$this->registerMigrations();
|
$this->registerMigrations();
|
||||||
|
|
||||||
$this->registerEvents();
|
$this->registerEvents();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -86,8 +83,8 @@ class OfflinePaymentServiceProvider extends ServiceProvider
|
|||||||
|
|
||||||
public function registerEvents()
|
public function registerEvents()
|
||||||
{
|
{
|
||||||
$this->app['events']->listen(AdminMenuCreated::class, OfflinePaymentAdminMenu::class);
|
$this->app['events']->listen(AdminMenuCreated::class, AdminMenu::class);
|
||||||
$this->app['events']->listen(PaymentGatewayListing::class, OfflinePaymentGateway::class);
|
$this->app['events']->listen(PaymentGatewayListing::class, Gateway::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace Modules\PaypalStandard\Events\Handlers;
|
namespace Modules\PaypalStandard\Listeners;
|
||||||
|
|
||||||
use App\Events\PaymentGatewayListing;
|
use App\Events\PaymentGatewayListing;
|
||||||
|
|
||||||
class PaypalStandardGateway
|
class Gateway
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Handle the event.
|
* Handle the event.
|
@ -2,10 +2,9 @@
|
|||||||
|
|
||||||
namespace Modules\PaypalStandard\Providers;
|
namespace Modules\PaypalStandard\Providers;
|
||||||
|
|
||||||
use Illuminate\Support\ServiceProvider;
|
|
||||||
|
|
||||||
use App\Events\PaymentGatewayListing;
|
use App\Events\PaymentGatewayListing;
|
||||||
use Modules\PaypalStandard\Listeners\PaypalStandardGateway;
|
use Illuminate\Support\ServiceProvider;
|
||||||
|
use Modules\PaypalStandard\Listeners\Gateway;
|
||||||
|
|
||||||
class PaypalStandardServiceProvider extends ServiceProvider
|
class PaypalStandardServiceProvider extends ServiceProvider
|
||||||
{
|
{
|
||||||
@ -25,8 +24,6 @@ class PaypalStandardServiceProvider extends ServiceProvider
|
|||||||
{
|
{
|
||||||
$this->registerTranslations();
|
$this->registerTranslations();
|
||||||
$this->registerViews();
|
$this->registerViews();
|
||||||
$this->registerMigrations();
|
|
||||||
|
|
||||||
$this->registerEvents();
|
$this->registerEvents();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -76,14 +73,9 @@ class PaypalStandardServiceProvider extends ServiceProvider
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function registerMigrations()
|
|
||||||
{
|
|
||||||
$this->loadMigrationsFrom(__DIR__ . '/../Database/Migrations');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function registerEvents()
|
public function registerEvents()
|
||||||
{
|
{
|
||||||
$this->app['events']->listen(PaymentGatewayListing::class, PaypalStandardGateway::class);
|
$this->app['events']->listen(PaymentGatewayListing::class, Gateway::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user