fixed category and product route
This commit is contained in:
parent
fea082bb0b
commit
af91641ae4
|
|
@ -18,7 +18,7 @@ class CategoryList extends JsonResource
|
|||
$item = [
|
||||
'id' => $this->id,
|
||||
'name' => $this->description->name ?? '',
|
||||
// 'url' => url()->route('shop.categories.show', ['category' => $this])
|
||||
'url' => shop_route('categories.show', ['category' => $this])
|
||||
];
|
||||
|
||||
if ($this->relationLoaded('children') && $this->children->count() > 0) {
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ class ProductList extends JsonResource
|
|||
return [
|
||||
'id' => $this->id,
|
||||
'name' => $this->description->name ?? '',
|
||||
'url' => url()->route('shop.products.show', ['product' => $this]),
|
||||
'url' => shop_route('products.show', ['product' => $this]),
|
||||
'price' => $this->price,
|
||||
'image' => image_resize($this->image),
|
||||
'price_format' => currency_format($this->price),
|
||||
|
|
|
|||
|
|
@ -23,8 +23,11 @@ class ShopServiceProvider extends ServiceProvider
|
|||
$this->loadRoutesFrom(__DIR__ . '/../Routes/shop.php');
|
||||
$this->mergeConfigFrom(__DIR__ . '/../../Config/beike.php', 'beike');
|
||||
$this->loadSettings();
|
||||
$this->loadShareView();
|
||||
$this->registerGuard();
|
||||
|
||||
$this->app->booted(function () {
|
||||
$this->loadShareView();
|
||||
});
|
||||
}
|
||||
|
||||
protected function loadSettings()
|
||||
|
|
@ -49,7 +52,7 @@ class ShopServiceProvider extends ServiceProvider
|
|||
|
||||
protected function registerGuard()
|
||||
{
|
||||
Config::set('auth.guards.'.Customer::AUTH_GUARD, [
|
||||
Config::set('auth.guards.' . Customer::AUTH_GUARD, [
|
||||
'driver' => 'session',
|
||||
'provider' => 'shop_customer',
|
||||
]);
|
||||
|
|
|
|||
Loading…
Reference in New Issue