diff --git a/plugins/HeaderMenu/Bootstrap.php b/plugins/HeaderMenu/Bootstrap.php index 19c5db29..34b1739a 100644 --- a/plugins/HeaderMenu/Bootstrap.php +++ b/plugins/HeaderMenu/Bootstrap.php @@ -14,6 +14,15 @@ namespace Plugin\HeaderMenu; class Bootstrap { public function boot() + { + $this->addHeaderMenu(); + } + + + /** + * 在网页头部添加二级菜单链接 + */ + private function addHeaderMenu() { add_filter('header.categories', function ($data) { $data[] = [ diff --git a/plugins/HeaderMenu/Views/latest_products.blade.php b/plugins/HeaderMenu/Views/latest_products.blade.php index f4c42b44..cb5c1a64 100644 --- a/plugins/HeaderMenu/Views/latest_products.blade.php +++ b/plugins/HeaderMenu/Views/latest_products.blade.php @@ -4,10 +4,11 @@
+
@foreach ($products as $product)
@include('shared.product')
diff --git a/plugins/HeaderMenu/routes.php b/plugins/HeaderMenu/routes.php index d31228e2..bab9d41c 100644 --- a/plugins/HeaderMenu/routes.php +++ b/plugins/HeaderMenu/routes.php @@ -12,4 +12,3 @@ use Illuminate\Support\Facades\Route; Route::get('/latest_products', '\Plugin\HeaderMenu\Controllers\MenusController@latestProducts')->name('plugin.latest_products'); -