Skip to content

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.

feat(dashboard): display project icons in project cards

Andras Bacsai96f55e3e3146
diff --git a/resources/views/livewire/dashboard.blade.php b/resources/views/livewire/dashboard.blade.php
index eb48314bf5..e9f8b32731 100644
--- a/resources/views/livewire/dashboard.blade.php
+++ b/resources/views/livewire/dashboard.blade.php
@@ -65,7 +65,13 @@
<div class="flex min-w-0 items-start gap-3">
<div
class="flex size-8 shrink-0 items-center justify-center rounded-lg border border-neutral-200 bg-neutral-50 text-neutral-500 dark:border-white/[0.08] dark:bg-white/[0.04] dark:text-fg-dim">
- <x-reicon name="projects" class="size-4" />
+ @if ($project->icon_path)
+ <img src="{{ route('project.icon', ['project_uuid' => $project->uuid, 'v' => $project->updated_at->timestamp]) }}"
+ alt="{{ $project->name }} icon"
+ class="h-full w-full rounded-lg object-cover">
+ @else
+ <x-reicon name="projects" class="size-4" />
+ @endif
</div>
<div class="min-w-0 flex-1">
<h3
diff --git a/tests/Feature/ProjectIconTest.php b/tests/Feature/ProjectIconTest.php
index db4d74df45..6f5357c5c5 100644
--- a/tests/Feature/ProjectIconTest.php
+++ b/tests/Feature/ProjectIconTest.php
@@ -1,5 +1,6 @@
<?php
+use App\Livewire\Dashboard;
use App\Livewire\Project\Edit;
use App\Livewire\Project\Index;
use App\Models\InstanceSettings;
@@ -99,3 +100,16 @@ it('exposes the icon URL on the projects index', function () {
'v' => $this->project->updated_at->timestamp,
]));
});
+
+it('displays the project icon on the dashboard', function () {
+ $this->project->forceFill([
+ 'icon_path' => "project-icons/{$this->project->uuid}/icon.jpg",
+ 'icon_storage_type' => 'local',
+ ])->save();
+
+ Livewire::test(Dashboard::class)
+ ->assertSeeHtml('src="'.route('project.icon', [
+ 'project_uuid' => $this->project->uuid,
+ 'v' => $this->project->updated_at->timestamp,
+ ]).'"');
+});