Neeraj1005
5 months ago
852
11
Laravel

SQLSTATE[42S22]: Column not found: 1054 Unknown column '_token' in 'field list' (SQL: update `todos` set `_token` = UonSH9zn8ELeZFunPC2JKutqsSJ8tZDKDmkUHUJw, `_method` = put, `title` = With Lead Ramesh kumar, `description` = Mollitia anim volupt, `tasktyp

Posted 5 months ago by Neeraj1005

When I'm trying to update the polymorphic table, I'm getting this. something I've missed ? plz solve to this problem

    public function update(CreateTaskRequest $request, Todo $task)
    {
        $lead = Tbl_leads::find($request->lead_id);

        $input = $request->validated();

        $input['user_id'] = Auth::user()->id;

        if ($request->lead_id == '') {

            $input = $request->except(['todoable_id']);

            $task->update($input);

        } else {

            $lead->todos()->update($input);
        }


        return redirect(route('tasks.index'))->with('success','succesfully updated');

    }

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