- Added `UserAppAccessService` for retrieving active services by user with detailed role and permission validation. - Created `ServiceAppDto` to standardize service data for UI rendering. - Enhanced user dashboard layout and Livewire component with computed services, role-based restricted access, and expiring service warnings. - Updated dashboard blade views for improved user experience and dynamic active services display.
24 lines
462 B
PHP
24 lines
462 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Helpers;
|
|
|
|
use App\Enums\DefaultUserRole;
|
|
use Illuminate\Support\Collection;
|
|
|
|
class DashboardRoute
|
|
{
|
|
/**
|
|
* This function will resolve the dashboard route based on the user role.
|
|
*/
|
|
public static function resolve(Collection $roles): string
|
|
{
|
|
if ($roles->contains(DefaultUserRole::Admin->value)) {
|
|
return 'dashboard.admin';
|
|
}
|
|
|
|
return 'dashboard.user';
|
|
}
|
|
}
|