diff --git a/beike/Shop/Routes/breadcrumbs.php b/beike/Shop/Routes/breadcrumbs.php deleted file mode 100644 index 4fa97b0f..00000000 --- a/beike/Shop/Routes/breadcrumbs.php +++ /dev/null @@ -1,37 +0,0 @@ - - * @created 2022-07-26 17:26:37 - * @modified 2022-07-26 17:26:37 - */ - -use Diglactic\Breadcrumbs\Breadcrumbs; -use Diglactic\Breadcrumbs\Generator as BreadcrumbTrail; - -// Home -Breadcrumbs::for('home', function (BreadcrumbTrail $trail) { - $trail->push('首页', shop_route('home.index')); -}); - -// Home > [Category] -Breadcrumbs::for('category', function (BreadcrumbTrail $trail, $category) { - $trail->parent('home'); - $trail->push($category->description->name, shop_route('categories.show', $category)); -}); - -// Home > Category > [Product] -Breadcrumbs::for('product', function (BreadcrumbTrail $trail, $product) { - $productModel = \Beike\Models\Product::query()->find($product['id']); - $category = $productModel->categories->first(); - if ($category) { - $trail->parent('category', $category); - } else { - $trail->parent('home'); - } - $trail->push($product['name'], shop_route('products.show', $productModel)); -}); - diff --git a/composer.json b/composer.json index 6b22cd21..8f54e396 100644 --- a/composer.json +++ b/composer.json @@ -8,7 +8,6 @@ "php": "^7.4|^8.0", "ext-json": "*", "ext-zip": "*", - "diglactic/laravel-breadcrumbs": "^7.2", "doctrine/dbal": "^3.3", "fruitcake/laravel-cors": "^2.0", "guzzlehttp/guzzle": "^7.2", diff --git a/composer.lock b/composer.lock index 5d873065..4833ed21 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "baf9504253adfc5cc3fd0b9e881f26a1", + "content-hash": "b0d15109abae83061530a0836ca3b001", "packages": [ { "name": "asm89/stack-cors", @@ -215,83 +215,6 @@ }, "time": "2021-08-13T13:06:58+00:00" }, - { - "name": "diglactic/laravel-breadcrumbs", - "version": "v7.2.0", - "source": { - "type": "git", - "url": "https://github.com/diglactic/laravel-breadcrumbs.git", - "reference": "309ec597d047b763d1df3c5113a3932cc771500f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/diglactic/laravel-breadcrumbs/zipball/309ec597d047b763d1df3c5113a3932cc771500f", - "reference": "309ec597d047b763d1df3c5113a3932cc771500f", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] - }, - "require": { - "facade/ignition-contracts": "^1.0", - "laravel/framework": "^6.0 || ^7.0 || ^8.0 || ^9.0", - "php": "^7.2 || ^8.0" - }, - "conflict": { - "davejamesmiller/laravel-breadcrumbs": "*" - }, - "require-dev": { - "orchestra/testbench": "^4.10 || ^5.9 || ^6.4 || ^7.0", - "php-coveralls/php-coveralls": "^2.4", - "phpunit/phpunit": "^8.5 || ^9.4", - "spatie/phpunit-snapshot-assertions": "^2.2 || ^4.2" - }, - "type": "library", - "extra": { - "laravel": { - "providers": [ - "Diglactic\\Breadcrumbs\\ServiceProvider" - ], - "aliases": { - "Breadcrumbs": "Diglactic\\Breadcrumbs\\Breadcrumbs" - } - } - }, - "autoload": { - "psr-4": { - "Diglactic\\Breadcrumbs\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Sheng Slogar", - "email": "sheng@diglactic.com", - "role": "Maintainer" - }, - { - "name": "Dave James Miller", - "email": "dave@davejamesmiller.com", - "role": "Original Creator" - } - ], - "description": "A simple Laravel-style way to create breadcrumbs.", - "homepage": "https://github.com/diglactic/laravel-breadcrumbs", - "keywords": [ - "laravel" - ], - "support": { - "issues": "https://github.com/diglactic/laravel-breadcrumbs/issues", - "source": "https://github.com/diglactic/laravel-breadcrumbs/tree/v7.2.0" - }, - "time": "2022-05-03T05:40:37+00:00" - }, { "name": "doctrine/cache", "version": "2.2.0", @@ -977,65 +900,6 @@ ], "time": "2022-06-18T20:57:19+00:00" }, - { - "name": "facade/ignition-contracts", - "version": "1.0.2", - "source": { - "type": "git", - "url": "https://github.com/facade/ignition-contracts.git", - "reference": "3c921a1cdba35b68a7f0ccffc6dffc1995b18267" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/facade/ignition-contracts/zipball/3c921a1cdba35b68a7f0ccffc6dffc1995b18267", - "reference": "3c921a1cdba35b68a7f0ccffc6dffc1995b18267", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] - }, - "require": { - "php": "^7.3|^8.0" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "^v2.15.8", - "phpunit/phpunit": "^9.3.11", - "vimeo/psalm": "^3.17.1" - }, - "type": "library", - "autoload": { - "psr-4": { - "Facade\\IgnitionContracts\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Freek Van der Herten", - "email": "freek@spatie.be", - "homepage": "https://flareapp.io", - "role": "Developer" - } - ], - "description": "Solution contracts for Ignition", - "homepage": "https://github.com/facade/ignition-contracts", - "keywords": [ - "contracts", - "flare", - "ignition" - ], - "support": { - "issues": "https://github.com/facade/ignition-contracts/issues", - "source": "https://github.com/facade/ignition-contracts/tree/1.0.2" - }, - "time": "2020-10-16T08:27:54+00:00" - }, { "name": "fruitcake/laravel-cors", "version": "v2.2.0", @@ -6907,6 +6771,65 @@ ], "time": "2022-03-03T08:28:38+00:00" }, + { + "name": "facade/ignition-contracts", + "version": "1.0.2", + "source": { + "type": "git", + "url": "https://github.com/facade/ignition-contracts.git", + "reference": "3c921a1cdba35b68a7f0ccffc6dffc1995b18267" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/facade/ignition-contracts/zipball/3c921a1cdba35b68a7f0ccffc6dffc1995b18267", + "reference": "3c921a1cdba35b68a7f0ccffc6dffc1995b18267", + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "require": { + "php": "^7.3|^8.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^v2.15.8", + "phpunit/phpunit": "^9.3.11", + "vimeo/psalm": "^3.17.1" + }, + "type": "library", + "autoload": { + "psr-4": { + "Facade\\IgnitionContracts\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Freek Van der Herten", + "email": "freek@spatie.be", + "homepage": "https://flareapp.io", + "role": "Developer" + } + ], + "description": "Solution contracts for Ignition", + "homepage": "https://github.com/facade/ignition-contracts", + "keywords": [ + "contracts", + "flare", + "ignition" + ], + "support": { + "issues": "https://github.com/facade/ignition-contracts/issues", + "source": "https://github.com/facade/ignition-contracts/tree/1.0.2" + }, + "time": "2020-10-16T08:27:54+00:00" + }, { "name": "fakerphp/faker", "version": "v1.19.0", diff --git a/config/breadcrumbs.php b/config/breadcrumbs.php deleted file mode 100644 index cb68558b..00000000 --- a/config/breadcrumbs.php +++ /dev/null @@ -1,75 +0,0 @@ - 'breadcrumbs::bootstrap5', - - /* - |-------------------------------------------------------------------------- - | Breadcrumbs File(s) - |-------------------------------------------------------------------------- - | - | The file(s) where breadcrumbs are defined. e.g. - | - | - base_path('routes/breadcrumbs.php') - | - glob(base_path('breadcrumbs/*.php')) - | - */ - - 'files' => base_path('beike/Shop/Routes/breadcrumbs.php'), - - /* - |-------------------------------------------------------------------------- - | Exceptions - |-------------------------------------------------------------------------- - | - | Determine when to throw an exception. - | - */ - - // When route-bound breadcrumbs are used but the current route doesn't have a name (UnnamedRouteException) - 'unnamed-route-exception' => true, - - // When route-bound breadcrumbs are used and the matching breadcrumb doesn't exist (InvalidBreadcrumbException) - 'missing-route-bound-breadcrumb-exception' => true, - - // When a named breadcrumb is used but doesn't exist (InvalidBreadcrumbException) - 'invalid-named-breadcrumb-exception' => true, - - /* - |-------------------------------------------------------------------------- - | Classes - |-------------------------------------------------------------------------- - | - | Subclass the default classes for more advanced customisations. - | - */ - - // Manager - 'manager-class' => Diglactic\Breadcrumbs\Manager::class, - - // Generator - 'generator-class' => Diglactic\Breadcrumbs\Generator::class, - -]; diff --git a/resources/lang/en/shop/products.php b/resources/lang/en/shop/products.php new file mode 100644 index 00000000..87361ccb --- /dev/null +++ b/resources/lang/en/shop/products.php @@ -0,0 +1,14 @@ + + * @created 2022-08-18 08:31:03 + * @modified 2022-08-18 08:31:03 + */ + +return [ + 'search' => 'Search', +]; diff --git a/resources/lang/zh_cn/shop/products.php b/resources/lang/zh_cn/shop/products.php new file mode 100644 index 00000000..f5a60a09 --- /dev/null +++ b/resources/lang/zh_cn/shop/products.php @@ -0,0 +1,14 @@ + + * @created 2022-08-18 08:31:03 + * @modified 2022-08-18 08:31:03 + */ + +return [ + 'search' => '搜索', +]; diff --git a/themes/default/search.blade.php b/themes/default/search.blade.php index 86d53c04..70ec2a36 100644 --- a/themes/default/search.blade.php +++ b/themes/default/search.blade.php @@ -4,7 +4,7 @@ @section('content')