deployer fixes

This commit is contained in:
Mark Gregory
2026-10-12 09:53:48 +01:00
parent 2139e55137
commit 85f9e56b03
9 changed files with 84 additions and 2 deletions
+10 -1
View File
@@ -3,6 +3,7 @@
namespace App\Http\Controllers;
use App\Models\SiteSetting;
use App\Models\DownloadProduct;
use App\Models\SonarDeskRelease;
use Illuminate\Http\Response;
use Illuminate\Support\Facades\Storage;
@@ -16,8 +17,9 @@ final class ReleaseController extends Controller
?? SonarDeskRelease::published()->where('channel', 'stable')->orderByDesc('published_at')->orderByDesc('id')->first();
$releases = SonarDeskRelease::published()->orderByDesc('published_at')->paginate(12);
$settings = $this->settings();
$products = DownloadProduct::where('is_published', true)->whereNotNull('file_path')->orderBy('name')->get();
return view('downloads.index', compact('latest', 'releases', 'settings'));
return view('downloads.index', compact('latest', 'releases', 'settings', 'products'));
}
public function latest(): BinaryFileResponse
@@ -32,6 +34,13 @@ final class ReleaseController extends Controller
return $this->send($release);
}
public function productDownload(DownloadProduct $product): BinaryFileResponse
{
abort_unless($product->is_published && $product->file_path && Storage::disk('local')->exists($product->file_path), 404);
$product->increment('download_count');
return response()->download(Storage::disk('local')->path($product->file_path), $product->original_filename);
}
public function appcast(): Response
{
$releases = SonarDeskRelease::published()->where('channel', 'stable')->orderByDesc('published_at')->limit(20)->get();