Replies: 1 comment
-
public function show($id) {
return Product::with('media')->find($id)->first();
}
public function index(){
return Product::with('media')->all();
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi everybody!
Little question, maybe stupid... but i not sure to understand how return media of a item in a API.
My Product model:
And in my ProductController:
I don't understand how add my medias (product_main and product_gallery) in theses two api (show and index).
Thanks a lot!
Vincent
Beta Was this translation helpful? Give feedback.
All reactions