- Reverts the schneespur/ subdirectory restructure (b8e426b)
- Restores package.json and vite.config.js (needed for npm build, were
removed in an earlier cleanup before the restructure)
- Updates public/build/ assets with current Vite output (new content hashes)
27 lines
731 B
PHP
27 lines
731 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
use Illuminate\Support\Facades\Storage;
|
|
use Symfony\Component\HttpFoundation\Response;
|
|
|
|
class StorageFallbackController extends Controller
|
|
{
|
|
public function __invoke(string $path): Response
|
|
{
|
|
$disk = Storage::disk('public');
|
|
|
|
if (! $disk->exists($path)) {
|
|
abort(404);
|
|
}
|
|
|
|
$mimeType = $disk->mimeType($path) ?: 'application/octet-stream';
|
|
$lastModified = $disk->lastModified($path);
|
|
|
|
return response($disk->get($path), 200, [
|
|
'Content-Type' => $mimeType,
|
|
'Cache-Control' => 'public, max-age=604800',
|
|
'Last-Modified' => gmdate('D, d M Y H:i:s', $lastModified) . ' GMT',
|
|
]);
|
|
}
|
|
}
|