I'm trying to
public function show(Product $product)
{
return ProductDetailResource::collection($product);
}
Call to undefined method App\ Model ::mapInto(), exception: BadMethodCallException file vendor\laravel\framework\src\Illuminate\Support\Traits\ForwardsCalls.php
then google and cant find any results
just need to replace
public function show(Product $product)
{
return ProductDetailResource::make($product);
}
instead of:
public function show(Product $product)
{
return ProductDetailResource::collection($product);
}
because collection for $products and collection of product.
but we have one item here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With