Looking to hire Laravel developers? Try LaraJobs

laravel-seo-urls maintained by luna

Description
Create SEO friendly urls/routes
Last update
2019/03/10 18:20 (dev-master)
License
Links
Downloads
62

Comments
comments powered by Disqus

SEO Urls

Setup

Add the service provider to the providers in config/app.php AFTER the RouteServiceProvider.

Luna\SeoUrls\SeoUrlServiceProvider::class

Add the following code to 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();
    }