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
@@ -11,12 +11,11 @@ class MessageQueryService
public function getUserRoleName(int $userId): ?string
{
$user = User::query()->with('roles')->find($userId);
if (! $user) {
if (!$user) {
return null;
}
$role = $user->roles->sortBy('id')->first();
return $role ? (string) $role->name : null;
}
@@ -68,7 +67,7 @@ class MessageQueryService
->pluck('id')
->all();
if (! empty($ids)) {
if (!empty($ids)) {
Message::query()
->whereIn('id', $ids)
->update([
@@ -91,7 +90,7 @@ class MessageQueryService
{
$query = Message::query()->with(['sender', 'recipient']);
if (! empty($filters['priority'])) {
if (!empty($filters['priority'])) {
$query->where('priority', $filters['priority']);
}
@@ -99,8 +98,8 @@ class MessageQueryService
$query->where('read_status', (int) $filters['read_status']);
}
if (! empty($filters['search'])) {
$term = '%'.$filters['search'].'%';
if (!empty($filters['search'])) {
$term = '%' . $filters['search'] . '%';
$query->where(function ($q) use ($term) {
$q->where('subject', 'like', $term)
->orWhere('message', 'like', $term);