Move Dashboard registrations

This commit is contained in:
philipp lang 2024-10-14 21:29:33 +02:00
parent eae4eaf55a
commit 858e4efec6
2 changed files with 11 additions and 13 deletions

View File

@ -6,13 +6,6 @@ use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Blade; use Illuminate\Support\Facades\Blade;
use Illuminate\View\ComponentAttributeBag; use Illuminate\View\ComponentAttributeBag;
use Livewire\Livewire; 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 class BaseServiceProvider extends ServiceProvider
{ {
@ -25,12 +18,6 @@ class BaseServiceProvider extends ServiceProvider
Blade::componentNamespace('App\\View\\Page', 'page'); Blade::componentNamespace('App\\View\\Page', 'page');
Blade::componentNamespace('App\\View\\Form', 'form'); Blade::componentNamespace('App\\View\\Form', 'form');
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) { ComponentAttributeBag::macro('mergeWhen', function ($condition, $key, $attributes) {
/** @var ComponentAttributeBag */ /** @var ComponentAttributeBag */
$self = $this; $self = $this;

View File

@ -5,6 +5,11 @@ namespace Modules\Dashboard;
use Illuminate\Routing\Router; use Illuminate\Routing\Router;
use Illuminate\Support\ServiceProvider; use Illuminate\Support\ServiceProvider;
use Modules\Dashboard\Components\DashboardComponent; use Modules\Dashboard\Components\DashboardComponent;
use Modules\Invoice\MemberPaymentBlock;
use Modules\Member\AgeGroupCountBlock;
use Modules\Member\TestersBlock;
use Modules\Prevention\EfzPendingBlock;
use Modules\Prevention\PsPendingBlock;
class DashboardServiceProvider extends ServiceProvider class DashboardServiceProvider extends ServiceProvider
{ {
@ -28,5 +33,11 @@ class DashboardServiceProvider extends ServiceProvider
app(Router::class)->middleware(['web', 'auth:web'])->group(function ($router) { app(Router::class)->middleware(['web', 'auth:web'])->group(function ($router) {
$router->get('/', DashboardComponent::class)->name('home'); $router->get('/', DashboardComponent::class)->name('home');
}); });
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);
} }
} }