Level 60
php artisan route:list
public function update(UpdateRequest $request, $user_information) // wildcard is called `user_information`
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi there
I have the route below in my API route file
Route::prefix('v1')->group(function() {
Route::prefix('kyc')->group(function (){
Route::apiResource('user-informations', UserInformation::class);
});
});
and my update method in my API controller
public function update(UpdateRequest $request, $user_id)
{
$validated_data = $request->validated();
$user = $this->userRepository->findOrFail($user_id);
$data = [
'user_id' => $user->id,
'user_first_name' => $validated_data['first_name'],
'user_last_name' => $validated_data['last_name'],
'user_sex' => $validated_data['gender'] == 'male' ? $this->userRepository::MALE : $this->userRepository::FEMALE,
'user_date_of_birth' => $validated_data['date_of_birth'],
'user_national_code' => $validated_data['card_id'],
'user_landline_phone' => $validated_data['landline_numnber'],
'user_address' => $validated_data['address'],
];
$kycService = new KYCService($data, 'UserInformation', false);
if($kycService->perform())
return response()->json([
'message' => 'اطلاعات شما برای احراز هویت با موفقیت ثبت شد'
]);
}
the result that I get is the error below when I try to send some information with Postman
Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException
The PUT method is not supported for this route. Supported methods: GET, HEAD.
thanks in advance
Please or to participate in this conversation.