diff --git a/resources/views/pages/tickets/⚡index.blade.php b/resources/views/pages/tickets/⚡index.blade.php
index 29b9332..5cd7c4d 100644
--- a/resources/views/pages/tickets/⚡index.blade.php
+++ b/resources/views/pages/tickets/⚡index.blade.php
@@ -88,6 +88,14 @@ public function boot(TicketService $ticketService, UserAppAccessService $appAcce
public function mount(): void
{
+ // Auto-open drawer if requested from URL
+ if ($this->raise) {
+ $this->drawerOpen = true;
+ if ($this->appId) {
+ $this->form->connectedAppId = $this->appId;
+ }
+ }
+
// Pre-populate dynamic choice lists
$this->searchApps();
$this->searchRoles();
@@ -100,18 +108,11 @@ public function mount(): void
$this->form->notifiedRoleIds = [$defaultRole->id];
}
- // Auto-open drawer if requested from URL
- if ($this->raise) {
- $this->drawerOpen = true;
- if ($this->appId) {
- $this->form->connectedAppId = $this->appId;
- }
- }
-
// Auto-open ticket if requested from URL
if ($this->ticketParam && (int) $this->ticketParam > 0) {
$this->showTicket((int) $this->ticketParam);
}
+ ds($this->appId);
}
/**
@@ -193,14 +194,14 @@ public function searchApps(string $value = ''): void
}
}
- $this->appsSearchable = $apps
+ $this->appsSearchable = array_values($apps
->when('' !== $value,
fn($col) => $col->filter(fn($app) => str_contains(strtolower($app->name), strtolower($value))))
->map(fn($app) => [
'id' => $app->id,
'name' => $app->name.(isset($app->days_remaining) ? ' ('.$app->days_remaining.' days left)' : ''),
])
- ->toArray();
+ ->toArray());
}
/**
@@ -210,7 +211,7 @@ public function searchRoles(string $value = ''): void
{
$selectedIds = $this->form->notifiedRoleIds;
- $this->rolesSearchable = Role::query()
+ $this->rolesSearchable = array_values(Role::query()
->where(function ($query) use ($value, $selectedIds): void {
if ('' !== $value) {
$query->where('name', 'like', "%{$value}%");
@@ -221,7 +222,7 @@ public function searchRoles(string $value = ''): void
})
->select('id', 'name')
->get()
- ->toArray();
+ ->toArray());
}
/**
@@ -231,7 +232,7 @@ public function searchUsers(string $value = ''): void
{
$selectedIds = $this->form->notifiedUserIds;
- $this->usersSearchable = User::query()
+ $this->usersSearchable = array_values(User::query()
->where('id', '!=', auth()->id())
->where(function ($query) use ($value, $selectedIds): void {
if ('' !== $value) {
@@ -244,7 +245,7 @@ public function searchUsers(string $value = ''): void
})
->select('id', 'name')
->get()
- ->toArray();
+ ->toArray());
}
/**
@@ -672,13 +673,15 @@ class="w-11/12 md:w-5/12 p-6 bg-white"
+ @ds($appsSearchable)