add role permission logic

This commit is contained in:
root
2026-03-10 17:11:48 -04:00
parent abebe0d9c0
commit c235fd2170
40 changed files with 1896 additions and 838 deletions
@@ -0,0 +1,19 @@
<?php
namespace App\Services\Roles;
use App\Models\Role;
class RoleDashboardService
{
/** @param string[] $roleKeys */
public function bestDashboardRouteFor(array $roleKeys): string
{
$rows = Role::findByNamesOrSlugs($roleKeys);
if (!empty($rows)) {
return $rows[0]->dashboard_route ?? '/landing_page/guest_dashboard';
}
return '/landing_page/guest_dashboard';
}
}