query('per_page', 10); $search = $request->query('search', ''); $program = Program::where('nama', 'like', "%$search%") ->paginate($perPage); return ProgramResource::collection($program); } /** * Store a newly created resource in storage. */ public function store(Request $request) { // } /** * Display the specified resource. */ public function show(string $id): ProgramResource { $program = Program::findOrFail($id); return new ProgramResource($program); } /** * Update the specified resource in storage. */ public function update(Request $request, string $id) { // } /** * Remove the specified resource from storage. */ public function destroy(string $id) { // } }