add test batches

This commit is contained in:
root
2026-06-08 23:45:55 -04:00
parent c792b8be05
commit 8d4d610b82
1480 changed files with 22587 additions and 10762 deletions
+6 -3
View File
@@ -3,6 +3,7 @@
namespace App\Services\Roles;
use App\Models\Role;
use App\Models\Staff;
use App\Models\User;
use App\Models\UserRole;
use Illuminate\Support\Facades\DB;
@@ -10,7 +11,9 @@ use Illuminate\Support\Facades\Log;
class RoleAssignmentService
{
public function __construct(private RoleStaffService $staffService) {}
public function __construct(private RoleStaffService $staffService)
{
}
/** @param int[] $roleIds */
public function assignRoles(int $userId, array $roleIds, ?int $adminId = null): array
@@ -18,7 +21,7 @@ class RoleAssignmentService
$roleIds = array_values(array_unique(array_filter(array_map('intval', $roleIds), fn ($id) => $id > 0)));
$user = User::query()->find($userId);
if (! $user) {
if (!$user) {
return ['ok' => false, 'message' => 'User not found.'];
}
@@ -35,7 +38,7 @@ class RoleAssignmentService
}
});
} catch (\Throwable $e) {
Log::error('Role assignment failed: '.$e->getMessage());
Log::error('Role assignment failed: ' . $e->getMessage());
throw $e;
}