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.

673 B
Raw Blame
<?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);

        return response($contents, 200, [
            'Content-Type' => 'image/jpeg',
            'Cache-Control' => 'private, max-age=31536000, immutable',
        ]);
    }
}