lokale
This commit is contained in:
parent
5a5056b9c2
commit
4c9a7f1043
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
namespace TPS\API\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use TPS\API\Http\Resources\Catalog\ProductVariant;
|
||||
use TPS\API\Http\Resources\Catalog\SuperAttribute;
|
||||
use TPS\Shop\Repositories\ProductRepository;
|
||||
|
|
@ -24,6 +25,19 @@ class Products extends ProductController
|
|||
{
|
||||
return ProductRepository::class;
|
||||
}
|
||||
/**
|
||||
* Returns an individual resource.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function getResource(Request $request, int $id)
|
||||
{
|
||||
$resourceClassName = $this->resource();
|
||||
|
||||
return new $resourceClassName($this->getRepositoryInstance()->findOrFail($id));
|
||||
}
|
||||
|
||||
public function variants($id){
|
||||
$product = $this->getRepositoryInstance()->findOrFail($id);
|
||||
|
|
|
|||
Loading…
Reference in New Issue