Files
ladill-care/app/Providers/AppServiceProvider.php
T
isaaccladandCursor 6c9c742ed8
Deploy Ladill Care / deploy (push) Failing after 13s
Initial Ladill Care release.
Healthcare management app: patients, appointments, consultations, lab,
pharmacy inventory, billing, and reports at care.ladill.com.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-29 11:36:22 +00:00

45 lines
1.2 KiB
PHP

<?php
namespace App\Providers;
use App\Events\ServiceEventOccurred;
use App\Listeners\PlatformServiceEventListener;
use App\Models\User;
use App\Services\Care\OrganizationResolver;
use App\Services\Care\PlanService;
use Illuminate\Support\Facades\Event;
use Illuminate\Support\Facades\View;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
public function register(): void
{
//
}
public function boot(): void
{
Event::listen(ServiceEventOccurred::class, PlatformServiceEventListener::class);
View::composer('partials.sidebar', function ($view) {
/** @var User|null $user */
$user = auth()->user();
$isPro = false;
if ($user) {
$organization = app(OrganizationResolver::class)->resolveForUser($user);
if ($organization) {
$isPro = app(PlanService::class)->isPro($organization);
}
}
$view->with('isPro', $isPro);
});
View::composer(['partials.topbar'], function ($view) {
$view->with(\App\Support\MobileTopbar::resolve());
});
}
}