mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-15 07:33:04 +01:00
48 lines
1.4 KiB
PHP
48 lines
1.4 KiB
PHP
<?php
|
|
|
|
namespace App\Providers;
|
|
|
|
use Illuminate\Support\Facades\Blade;
|
|
use Illuminate\Support\ServiceProvider as BaseProvider;
|
|
|
|
class RotessaServiceProvider extends BaseProvider
|
|
{
|
|
protected string $moduleName = 'Rotessa';
|
|
|
|
protected string $moduleNameLower = 'rotessa';
|
|
|
|
/**
|
|
* Boot the application events.
|
|
*/
|
|
public function boot(): void
|
|
{
|
|
include_once app_path('Http/ViewComposers/RotessaComposer.php');
|
|
class_alias("App\\PaymentDrivers\\Rotessa\\PaymentMethod","App\\PaymentDrivers\\Rotessa\\BankTransfer");
|
|
class_alias("App\\PaymentDrivers\\Rotessa\\PaymentMethod","App\\PaymentDrivers\\Rotessa\\Acss");
|
|
|
|
$this->registerViews();
|
|
}
|
|
|
|
/**
|
|
* Register views.
|
|
*/
|
|
public function registerViews(): void
|
|
{
|
|
$viewPath = resource_path('views/portal/ninja2020/gateways/'.$this->moduleNameLower);
|
|
$this->loadViewsFrom(array_merge($this->getPublishableViewPaths(), [$viewPath]), $this->moduleNameLower);
|
|
Blade::componentNamespace('App\\Http\\ViewComposers\\Components', $this->moduleNameLower);
|
|
}
|
|
|
|
private function getPublishableViewPaths(): array
|
|
{
|
|
$paths = [];
|
|
foreach (config('view.paths') as $path) {
|
|
if (is_dir($path.'/'.$this->moduleNameLower)) {
|
|
$paths[] = $path.'/'.$this->moduleNameLower;
|
|
}
|
|
}
|
|
|
|
return $paths;
|
|
}
|
|
}
|