restructure API Controllers (Master)

This commit is contained in:
2026-06-03 13:52:59 +07:00
parent 8e83413d34
commit 4021010618
6 changed files with 591 additions and 0 deletions
@@ -0,0 +1,69 @@
<?php
namespace App\Http\Controllers\Api\Master;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Illuminate\Http\JsonResponse;
use App\Models\Pertanian\Komoditas;
use Illuminate\Http\Resources\Json\AnonymousResourceCollection;
use App\Http\Resources\Pertanian\KomoditasResource;
class KomoditasController extends Controller
{
/**
* Display a listing of the resource.
*/
public function index(): AnonymousResourceCollection
{
return KomoditasResource::collection(Komoditas::all());
}
/**
* Show the form for creating a new resource.
*/
public function create()
{
//
}
/**
* Store a newly created resource in storage.
*/
public function store(Request $request)
{
//
}
/**
* Display the specified resource.
*/
public function show(string $id): JsonResponse
{
return response()->json(KomoditasResource::make(Komoditas::findOrFail($id)));
}
/**
* Show the form for editing the specified resource.
*/
public function edit(string $id)
{
//
}
/**
* Update the specified resource in storage.
*/
public function update(Request $request, string $id)
{
//
}
/**
* Remove the specified resource from storage.
*/
public function destroy(string $id)
{
//
}
}