1 year ago

Laravel page not found error while using global route prefix

Posted 1 year ago by hsntngr

I want to build multilingual website with laravel and I want to make urls seo friendly.

So I added language prefix to whole routes using RouteServiceProvider

            'middleware' => 'web',
            'namespace' => $this->namespace,
            'prefix' => $this->app->getLocale()
        ], function ($router) {...);

Are we should any parameter for the language ? Because I didin't use any parameter for routes..

Route::group(["prefix"=>trans("routes.admin")],function (){
    Route::get("/",["as"=>"admin.index","uses"=>"[email protected]"]);

I research about it on stackoverflow, laravel.com but I couldn't find anything useful.

How do I can fix this error ? Any help would be appreciated.

Please sign in or create an account to participate in this conversation.