Erster Upload

This commit is contained in:
Malek Tellissi
2026-09-11 01:17:47 +02:00
commit 400172cdde
171 changed files with 18844 additions and 0 deletions
@@ -0,0 +1,27 @@
<?php
namespace App\Http\Controllers\Api;
use App\Http\Controllers\Controller;
use App\Http\Resources\LotResource;
use App\Models\Batch;
use Illuminate\Http\JsonResponse;
class LotController extends Controller
{
public function show(string $lotNumber): LotResource|JsonResponse
{
$batch = Batch::with([
'product',
'recipe.spices',
'origins.spice',
'origins.supplier',
])->where('lot_number', $lotNumber)->first();
if (! $batch) {
return response()->json(['error' => 'LOT-Nummer nicht gefunden.'], 404);
}
return new LotResource($batch);
}
}