Add applications and positions

This commit is contained in:
Christoph Karlen
2026-02-02 17:39:41 +01:00
parent d2a517d2f5
commit b2366def84
26 changed files with 760 additions and 10 deletions

View File

@@ -0,0 +1,28 @@
<?php
namespace App\Http\Controllers;
use App\Models\Application;
use Illuminate\Contracts\Routing\ResponseFactory;
use Illuminate\Foundation\Application as IlluminateApplication;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Illuminate\Support\Facades\File;
class FileController extends Controller
{
public function show(
Request $request,
int $applicationId
): IlluminateApplication|Response|ResponseFactory {
$application = Application::query()->firstWhere('id', $applicationId);
$storagePath = storage_path('app') . '/private/' . $application->document;
$file = File::get($storagePath);
$type = File::mimeType($storagePath);
$response = response($file, 200);
$response->header('Content-Type', $type);
return $response;
}
}