52 lines
1.6 KiB
PHP
52 lines
1.6 KiB
PHP
<?php
|
|
|
|
namespace Modules\Base;
|
|
|
|
use Illuminate\Support\ServiceProvider;
|
|
use Illuminate\Support\Facades\Blade;
|
|
use Illuminate\View\ComponentAttributeBag;
|
|
use Livewire\Livewire;
|
|
use Modules\Base\Components\Page\Sidebar;
|
|
use Modules\Dashboard\DashboardFactory;
|
|
use Modules\Invoice\MemberPaymentBlock;
|
|
use Modules\Member\AgeGroupCountBlock;
|
|
use Modules\Member\TestersBlock;
|
|
use Modules\Prevention\EfzPendingBlock;
|
|
use Modules\Prevention\PsPendingBlock;
|
|
|
|
class BaseServiceProvider extends ServiceProvider
|
|
{
|
|
/**
|
|
* Register services.
|
|
*/
|
|
public function register(): void
|
|
{
|
|
Blade::componentNamespace('Modules\\Base\\Components\\Ui', 'ui');
|
|
Blade::componentNamespace('Modules\\Base\\Components\\Page', 'page');
|
|
|
|
|
|
app(DashboardFactory::class)->register(AgeGroupCountBlock::class);
|
|
app(DashboardFactory::class)->register(MemberPaymentBlock::class);
|
|
app(DashboardFactory::class)->register(TestersBlock::class);
|
|
app(DashboardFactory::class)->register(EfzPendingBlock::class);
|
|
app(DashboardFactory::class)->register(PsPendingBlock::class);
|
|
|
|
Livewire::component('page.sidebar', Sidebar::class);
|
|
|
|
ComponentAttributeBag::macro('mergeWhen', function ($condition, $key, $attributes) {
|
|
/** @var ComponentAttributeBag */
|
|
$self = $this;
|
|
return $condition ? $self->merge([$key => $attributes]) : $self;
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Bootstrap services.
|
|
*/
|
|
public function boot(): void
|
|
{
|
|
Livewire::component('pagesidebar', Sidebar::class);
|
|
//
|
|
}
|
|
}
|