generated from boboko/starter
Feat: Updating routes and controllers to use the updated Services coming from boboko/core
This commit is contained in:
@@ -3,7 +3,6 @@
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Response;
|
||||
use Lunar\Models\Collection;
|
||||
use Modules\Core\Catalog\Services\ProductService;
|
||||
|
||||
class ProductController extends Controller
|
||||
@@ -16,7 +15,6 @@ public function show(string $locale, int $id)
|
||||
abort_if($product === null, Response::HTTP_NOT_FOUND);
|
||||
|
||||
$collection = $product['collections'][0] ?? null;
|
||||
$collectionModel = $collection !== null ? Collection::find($collection['id']) : null;
|
||||
|
||||
$variantsData = collect($product['variants'])
|
||||
->map(fn (array $variant) => [
|
||||
@@ -30,12 +28,8 @@ public function show(string $locale, int $id)
|
||||
$firstVariant = $product['variants'][0] ?? null;
|
||||
$option = $firstVariant['options'][0]['option'] ?? null;
|
||||
|
||||
// temp categories here
|
||||
$categories = Collection::orderBy('_lft')->get();
|
||||
|
||||
return view('product.show', [
|
||||
'categories' => $categories,
|
||||
'collection' => $collectionModel,
|
||||
'collection' => $collection,
|
||||
'product' => $product,
|
||||
'option' => $option,
|
||||
'variantsData' => $variantsData,
|
||||
|
||||
Reference in New Issue
Block a user