初始化

This commit is contained in:
2026-08-08 18:27:38 +08:00
parent efc150c937
commit 060eb79c09
336 changed files with 24613 additions and 15 deletions
@@ -0,0 +1,34 @@
<?php
namespace App\Http\Controllers;
use App\Models\Solution;
use Illuminate\Http\Request;
use Illuminate\View\View;
class SolutionsController extends Controller
{
public function index(Request $request): View
{
$power = $request->query('power');
$application = $request->query('application');
$platform = $request->query('platform');
$solutions = Solution::published()
->when($power, fn ($q) => $q->where('power_segment', $power))
->when($application, fn ($q) => $q->where('application', $application))
->when($platform, fn ($q) => $q->where('chip_platform', $platform))
->get();
return view('solutions.index', compact('solutions', 'power', 'application', 'platform'));
}
public function show(Solution $solution): View
{
if ($solution->status !== 'published') {
abort(404);
}
return view('solutions.show', compact('solution'));
}
}