Laravel route url changing after app()->handle() function
I'm accessing an api in my own project, but now I'm having problem with the route function, after dispatching the request with app()->handle($req) , route function generate a different url $req = Request::create('/api/auth/login', 'POST', [ "user" => $request->user, "password" => $request->password, ]); $redirect = route('home'); // http://127.0.0.1:8000/home $res = app()->handle($req); $redirect = route('home'); // http://localhost/home What did I miss? Request::create() is a method inherited from Symfony's HTTP Request class. When called, if you do not pass in any $_SERVER details, it will