luna / laravel-seo-urls
创建SEO友好的URL/路由
1.0.0
2019-03-10 17:20 UTC
Requires
- illuminate/database: ^5.8
- illuminate/support: ^5.8
This package is auto-updated.
Last update: 2024-09-18 20:54:28 UTC
README
设置
在 config/app.php
中将服务提供者添加到 providers 中 在 RouteServiceProvider 之后。
Luna\SeoUrls\SeoUrlServiceProvider::class
将以下代码添加到 app/Http/Kernel.php 中
/** * Get the route dispatcher callback. * * @return \Closure */ protected function dispatchToRouter() { $this->router = $this->app->make('router'); foreach ($this->routeMiddleware as $key => $middleware) { $this->router->aliasMiddleware($key, $middleware); } foreach ($this->middlewareGroups as $key => $middleware) { $this->router->middlewareGroup($key, $middleware); } return parent::dispatchToRouter(); }