$this->index()] ); } /** * Display a listing of the resource. */ public function index() { $products = Product::with(['category', 'unit'])->orderBy('title', 'asc')->get(); return ApiDataTransformer::snakeToCamel($products->toArray()); } public function single($id) { $products = Product::with(['category', 'unit'])->findOrFail($id); return ApiDataTransformer::snakeToCamel($products->toArray()); } /** * Show the form for creating a new resource. */ public function create() { // } /** * Store a newly created resource in storage. */ public function store(Request $request) { // } /** * Show the form for editing the specified resource. */ public function edit(Product $product) { // } /** * Update the specified resource in storage. */ public function update(Request $request, Product $product) { // } /** * Remove the specified resource from storage. */ public function destroy(Product $product) { // } }