1 week ago

How do I pass user_id for updating perpose in admin page?

Posted 1 week ago by mimiloca

i'm creating update method to update user application status. This is in 1- M relationship. but I'm getting error with General error: 1364 Field 'user_id' doesn't have a default value

then i realized that i dont pass the user value so i want to put this method $application->user_id = $request->input('user_id') ; How to put that method or pass the user_id ? So admin can update the user application status.


<form class="form-horizontal" action="{{route('application.update')}}" method="POST" >
 public function edit($id)
        $applications = Application::with('user')->find($id);

        return view('application.edit')->with('application', $applications);

  public function update(Request $request)

            'status' =>'required',

        $applications = new Application;
        $applications->status = $request->input('status');
        return redirect('/application/view')->with('Success', 'Status updated!');

Please sign in or create an account to participate in this conversation.