app/Http/Controllers/Admin/CategoryController.php
/**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
Display a listing of the resource.
@return \Illuminate\Http\Response
Display a listing of the resource . @return \ Illuminate \ Http \ Response
public function index()
    {
        $categories =  Category::all();
        return response()->json([
            'categories' => $categories,
        ], 200);
    }
public function index ( ) { $ categories = Category :: all ( ) ; return response ( ) -> json ( [ 'categories' => $ categories , ] , 200 ) ; }
Display a listing of the resource.
Display a listing of the resource .