2026-08-13 20:56:52 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
|
|
|
|
|
|
use App\Models\Project;
|
|
|
|
|
use App\Services\ProjectIconStorageService;
|
|
|
|
|
use Illuminate\Http\Response;
|
|
|
|
|
|
|
|
|
|
class ProjectIconController extends Controller
|
|
|
|
|
{
|
|
|
|
|
public function __invoke(string $project_uuid, ProjectIconStorageService $iconStorage): Response
|
|
|
|
|
{
|
|
|
|
|
$project = Project::ownedByCurrentTeam()->where('uuid', $project_uuid)->firstOrFail();
|
|
|
|
|
$contents = $iconStorage->projectContents($project);
|
|
|
|
|
|
|
|
|
|
abort_if($contents === null, 404);
|
|
|
|
|
|
2026-09-04 19:15:06 +00:00
|
|
|
return response($contents, 200, [
|
|
|
|
|
'Content-Type' => 'image/jpeg',
|
|
|
|
|
'Cache-Control' => 'private, max-age=31536000, immutable',
|
|
|
|
|
]);
|
2026-08-13 20:56:52 +00:00
|
|
|
}
|
|
|
|
|
}
|