Skip to content

Commit

Permalink
[Fixes] Closes #7
Browse files Browse the repository at this point in the history
  • Loading branch information
craftisan committed May 7, 2020
1 parent 7d570ca commit 4ec07ff
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions app/Http/Middleware/LocaleMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,14 @@ public function handle($request, Closure $next)
'canonicalPath' => $this->getPathWithoutLocale($request),
'canonicalUrl' => config('app.url') . $this->getPathWithoutLocale($request) . '/',
]);
} else {
$request->merge([
'localeEnabled' => false,
'localePath' => '',
'localeUrl' => config('app.url'),
'canonicalPath' => $request->path(),
'canonicalUrl' => $request->getUri(),
]);
}

return $next($request);
Expand Down
2 changes: 1 addition & 1 deletion routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
Route::get('', 'CoronaController@home');
//Route::get('timeline', 'CoronaController@timeline');
//Route::get('{string?}/timeline', 'CoronaController@timeline')->where('string', '.*');
Route::get('corona-testing-per-day-india', 'CoronaController@testing')->where('string', '.*');
Route::get('corona-testing-per-day-india', 'CoronaController@testing');

// This should always be the last route in this file
Route::get('{string}', 'CoronaController@index')->where('string', '.*');

0 comments on commit 4ec07ff

Please sign in to comment.