adrema/app/Providers/BaseServiceProvider.php

47 lines
1.4 KiB
PHP
Raw Normal View History

2024-09-23 23:49:17 +02:00
<?php
2024-10-13 21:00:47 +02:00
namespace App\Providers;
2024-09-23 23:49:17 +02:00
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Blade;
use Illuminate\View\ComponentAttributeBag;
use Livewire\Livewire;
2024-09-24 01:26:08 +02:00
use Modules\Base\Components\Page\Sidebar;
2024-09-23 23:49:17 +02:00
use Modules\Dashboard\DashboardFactory;
use Modules\Invoice\MemberPaymentBlock;
use Modules\Member\AgeGroupCountBlock;
use Modules\Member\TestersBlock;
use Modules\Prevention\EfzPendingBlock;
use Modules\Prevention\PsPendingBlock;
2024-09-24 01:26:08 +02:00
class BaseServiceProvider extends ServiceProvider
2024-09-23 23:49:17 +02:00
{
/**
* Register services.
*/
public function register(): void
{
2024-10-13 21:00:47 +02:00
Blade::componentNamespace('App\\View\\Ui', 'ui');
Blade::componentNamespace('App\\View\\Page', 'page');
2024-09-23 23:49:17 +02:00
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);
ComponentAttributeBag::macro('mergeWhen', function ($condition, $key, $attributes) {
/** @var ComponentAttributeBag */
$self = $this;
return $condition ? $self->merge([$key => $attributes]) : $self;
});
}
/**
* Bootstrap services.
*/
public function boot(): void
{
}
}