score:0

According to you SQL query which you provided in your question comment here is the solution with Laravel Model:-

# this query will find your Gold item with there provided where conditions.
# you can pass more where conditions as per your requirements.
$gold = Gold::where('type', '=', $request->input('type'))
            ->where('parent_id', '=', $request->input('parent_id'))->first();

if(!$gold) {
    return throw Exception('Invalid Gold Item', 422);
}

$gold->comment = $request->input('comment');
$gold->userid = $request->input('userid');
$gold->save();

Here is the solution as per your requirement which I understand.


More Answer

More answer with same ag