Deploy HickLab3D Dashboard / Deploy to production (push) Failing after 23s
Replace the old touchmark/PNG identity with the supplied lockup and monogram, segmented role-aware navigation, Live/Draft listing filters with generation-based cache invalidation, and admin Projects covering immutable file revisions, listing live pointers, and exact-decimal filament/packaging/shipping costing. Additive schema only; no Etsy publication. Isolated clone tests: 301 tests, 1162 assertions.
21 lines
640 B
PHP
21 lines
640 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
use App\Models\Project;
|
|
use App\Models\ProjectFile;
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Support\Facades\Storage;
|
|
use Symfony\Component\HttpFoundation\StreamedResponse;
|
|
|
|
class ProjectFileController extends Controller
|
|
{
|
|
public function download(Request $request, Project $project, ProjectFile $file): StreamedResponse
|
|
{
|
|
abort_unless($file->revision->project_id === $project->id, 404);
|
|
abort_unless($request->user()->can('download', [$file, $project]), 403);
|
|
|
|
return Storage::disk('project_files')->download($file->storage_key, $file->original_filename);
|
|
}
|
|
}
|