This commit is contained in:
2026-02-03 15:31:29 +05:00
commit 326c677e8d
2800 changed files with 1489388 additions and 0 deletions

View File

@@ -0,0 +1,41 @@
<?php
namespace App\Http\Controllers\Web\Brand;
use App\Http\Controllers\Controller;
use App\Models\Ecommerce\Product\Brand\Brand;
use App\Repositories\Ecommerce\Product\ProductRepository;
use Illuminate\Http\Request;
class BrandController extends Controller
{
/**
* Display the specified resource.
*
* @return Application|Factory|View
*/
public function show(Brand $brand)
{
return to_route('web.brands.products', ['brand' => $brand->slug]);
}
/**
* Brand products
*/
public function products(Brand $brand, Request $request)
{
$products = ProductRepository::make($request)
->queryAsFromResource($brand)
->applyBasicQueries()
->applyFilters()
->applySorting()
->simplePaginate();
return $request->ajax()
? ProductRepository::ajaxPaginate($products)
: view('web.themes.shella.pages.brands.products.index', [
'brand' => $brand,
'products' => $products,
]);
}
}