An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.
PHP coolifydatabasesdeploymentdockerdocker-composeinertiajslaravelmariadbmysqlnextjsnodejsphppostgresredisself-hostedself-hostingserverstatic-sitesveltesvelte5
feat(storages): add method to retrieve the first storage ID for improved stability in storage display
Andras Bacsai13af4811f560
diff --git a/app/Livewire/Project/Shared/Storages/All.php b/app/Livewire/Project/Shared/Storages/All.phpindex c26315d3b2..63fc06a364 100644--- a/app/Livewire/Project/Shared/Storages/All.php+++ b/app/Livewire/Project/Shared/Storages/All.php@@ -9,4 +9,15 @@ class All extends Componentpublic $resource;protected $listeners = ['refreshStorages' => '$refresh'];++ public function getFirstStorageIdProperty()+ {+ if ($this->resource->persistentStorages->isEmpty()) {+ return null;+ }++ // Use the storage with the smallest ID as the "first" one+ // This ensures stability even when storages are deleted+ return $this->resource->persistentStorages->sortBy('id')->first()->id;+ }}diff --git a/resources/views/livewire/project/shared/storages/all.blade.php b/resources/views/livewire/project/shared/storages/all.blade.phpindex 45dad78b1b..d623625620 100644--- a/resources/views/livewire/project/shared/storages/all.blade.php+++ b/resources/views/livewire/project/shared/storages/all.blade.php@@ -3,10 +3,10 @@@foreach ($resource->persistentStorages as $storage)@if ($resource->type() === 'service')<livewire:project.shared.storages.show wire:key="storage-{{ $storage->id }}" :storage="$storage"- :resource="$resource" :isFirst="$loop->first" isService='true' />+ :resource="$resource" :isFirst="$storage->id === $this->firstStorageId" isService='true' />@else<livewire:project.shared.storages.show wire:key="storage-{{ $storage->id }}" :storage="$storage"- :resource="$resource" startedAt="{{ data_get($resource, 'started_at') }}" />+ :resource="$resource" :isFirst="$storage->id === $this->firstStorageId" startedAt="{{ data_get($resource, 'started_at') }}" />@endif@endforeach</div>