luna/laravel-seo-urls

Create SEO friendly urls/routes

1.0.0 2019-03-10 17:20 UTC

This package is auto-updated.

Last update: 2024-04-18 19:57:03 UTC


README

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();
    }