301 error normally means Moved Permanently so there has been a redirect somewhere.
Can you show the Routes File, And how You are sending the request to the route?
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
sent the following request to my api
$requestSvr1 = [
"id_server" => 999,
"task_available" => ["task11","mptupdatepoi", "mptupdatetrack", "mptupdateroute", "mptdeleteroute","mptdeletepoi"],
"exclude_instances" => ["romage.org"],
"accept_instances" => ["mde.org"]
];
when I take my request and let the validator work it I get 302.
I don't even get to print the dd
$requestSvr->only(['id_server', 'task_available','accept_instances','exclude_instances']);
$validator = $requestSvr->validate([
'id_server' => 'required|string',
'task_available' => 'required|array',
'accept_instances'=> 'array',
'exclude_instances' =>'array'
]);
dd($validator);
if($validator->fails()){
return response(['error' => $validator->errors(), 'Validation Error'],400);
}
dd ($ requestSvr); and I get this:
#json: null
#convertedFiles: [] #userResolver: Closure($guard = null) {#2894 class: "Illuminate\Auth\AuthServiceProvider" this: Illuminate\Auth\AuthServiceProvider {#83 …} use: { $app: Illuminate\Foundation\Application {#729 …} } file: "./vendor/laravel/framework/src/Illuminate/Auth/AuthServiceProvider.php" line: "105 to 107" } #routeResolver: Closure() {#3972 class: "Illuminate\Routing\Router" this: Illuminate\Routing\Router {#217 …} use: { $route: Illuminate\Routing\Route {#406 …} } file: "./vendor/laravel/framework/src/Illuminate/Routing/Router.php" line: "662 to 664" } +attributes: Symfony\Component\HttpFoundation\ParameterBag {#2896 #parameters: [] } +request: Symfony\Component\HttpFoundation\ParameterBag {#4115 #parameters: array:4 [ "id_server" => 999 "task_available" => array:6 [ 0 => "task11" 1 => "mptupdatepoi" 2 => "mptupdatetrack" 3 => "mptupdateroute" 4 => "mptdeleteroute" 5 => "mptdeletepoi" ] "exclude_instances" => array:1 [ 0 => "romage.org" ] "accept_instances" => array:1 [ 0 => "mde.org" ] ] } +query: Symfony\Component\HttpFoundation\InputBag {#3944 #parameters: [] } +server: Symfony\Component\HttpFoundation\ServerBag {#4126 #parameters: array:17 [ "SERVER_NAME" => "hoqu-laravel.test" "SERVER_PORT" => 80 "HTTP_HOST" => "hoqu-laravel.test" "HTTP_USER_AGENT" => "Symfony" "HTTP_ACCEPT" => "text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8" "HTTP_ACCEPT_LANGUAGE" => "en-us,en;q=0.5" "HTTP_ACCEPT_CHARSET" => "ISO-8859-1,utf-8;q=0.7,;q=0.7" "REMOTE_ADDR" => "127.0.0.1" "SCRIPT_NAME" => "" "SCRIPT_FILENAME" => "" "SERVER_PROTOCOL" => "HTTP/1.1" "REQUEST_TIME" => 1611144633 "PATH_INFO" => "" "REQUEST_METHOD" => "PUT" "CONTENT_TYPE" => "application/x-www-form-urlencoded" "REQUEST_URI" => "/api/pull" "QUERY_STRING" => "" ] } +files: Symfony\Component\HttpFoundation\FileBag {#4121 #parameters: [] } +cookies: Symfony\Component\HttpFoundation\InputBag {#3956 #parameters: [] } +headers: Symfony\Component\HttpFoundation\HeaderBag {#4110 #headers: array:6 [ "host" => array:1 [ 0 => "hoqu-laravel.test" ] "user-agent" => array:1 [ 0 => "Symfony" ] "accept" => array:1 [ 0 => "text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8" ] "accept-language" => array:1 [ 0 => "en-us,en;q=0.5" ] "accept-charset" => array:1 [ 0 => "ISO-8859-1,utf-8;q=0.7,;q=0.7" ] "content-type" => array:1 [ 0 => "application/x-www-form-urlencoded" ] ] #cacheControl: [] } #content: null #languages: null #charsets: null #encodings: null #acceptableContentTypes: null #pathInfo: "/api/pull" #requestUri: "/api/pull" #baseUrl: "" #basePath: null #method: "PUT" #format: null #session: null #locale: null #defaultLocale: "en" -preferredFormat: null -isHostValid: true -isForwardedValid: true -isSafeContentPreferred: null basePath: "" format: "html" }
Please or to participate in this conversation.