Skip to content

Commit d439e7f

Browse files
committed
Add badges system
1 parent 6304d26 commit d439e7f

40 files changed

+3285
-2
lines changed

app/Http/Controllers/AuthenticatedImageController.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
use App\Models\Article;
2020
use App\Models\Category;
21+
use App\Models\Collectible;
2122
use App\Models\Playlist;
2223
use App\Models\Torrent;
2324
use App\Models\User;
@@ -93,4 +94,13 @@ public function userIcon(User $user): \Symfony\Component\HttpFoundation\BinaryFi
9394

9495
return response()->file($path, self::HEADERS);
9596
}
97+
98+
public function collectibleIcon(Collectible $collectible): \Symfony\Component\HttpFoundation\BinaryFileResponse
99+
{
100+
$path = Storage::disk('collectible-icons')->path($collectible->icon);
101+
102+
abort_unless(file_exists($path), 404);
103+
104+
return response()->file($path, self::HEADERS);
105+
}
96106
}

0 commit comments

Comments
 (0)