when i try to access routes as guests with Auth middle ware it says that Missing required parameters for [Route: login] [URI: {lang}/login].
this is because i added localization to my website.
here is my home controller
class HomeController extends Controller { /** * Create a new controller instance. * * @return void */ public function __construct() { $this->middleware('auth'); $this->middleware('verified'); }
/**
* Show the application dashboard.
*
* @return \Illuminate\Contracts\Support\Renderable
*/
public function index($lang)
{
\App::setlocale($lang);
return view('home');
}
this is my authenticate.php middleware
protected function redirectTo($request)
{
if (! $request->expectsJson()) {
return route('login' , app()->getLocale());
}
}