Laravel API ResourceCollection tidak berhasil

use App\Http\Resources\ProductCollection;
use App\Http\Resources\ProductResource;
// for single collection resource in   
return new ProductCollection(Product::all()); //or
return ProductResource::collection(Product::all());
//for single resource
return new ProductResource(Product::findOrFail($id));
gerson ondangan