$file, 'content' => file_get_contents($path . $file), ]; } } if (empty($data)) { return response()->json([ 'status' => 'error', 'message' => 'No text files found', ], 404); } return response()->json([ 'status' => 'success', 'files' => $data, ]); } /** * Display the specified resource. */ public function show(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) { // } }