20 lines
430 B
PHP
20 lines
430 B
PHP
<?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';
|
|
}
|
|
}
|