I have created an api resource like http://app.localhost/api/product/info/1000
And it works fine and returns the desired data json format.
But, when I try to execute the resource in a controller like,
$Product = Product::where('sku', $this->sku)->get()->first();
$productInfo = new ProductRes($Product);
It return the full $Product Object, instead of json data. I have posted the screenshot of the object i have received.

Is it possible to render the resource in the same way as it does in the url?
Thanks
execute the resource in a controller? Return it?