Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

NikhilLVL's avatar

Getting error on user details updation

Argument 2 passed to Symfony\Component\HttpFoundation\RedirectResponse::__construct() must be of the type int, object given, called in C:\xampp\htdocs\Laravel\Hotel_Reservation\vendor\laravel\framework\src\Illuminate\Routing\Redirector.php

This is my controller, which takes new values and update the users table: public function NewProfile(Request $request)//Updating user profile { $user_id=session('id'); $data=User::find($user_id); $data->name=request('new_name'); $data->address=request('new_address'); $data->phone=request('new_phone'); $data->gender=request('gender'); $data->loginid=request('loginid'); $data->save(); $data['info']=User::getProfile($user_id); return redirect('userProfile',$data); }

This is my blade: @extends("layout") @section("navigation")

  • Your Bookings
  • Logout
  • @endsection @section("insertContent") @foreach($info as $item) @csrf @method('PUT') Name: Address:{{$item->address}} Phone: Username: Password: @endforeach @endsection
    0 likes
    1 reply

    Please or to participate in this conversation.