Question and answer is powered by AnsPress.io
I create a resource controller for my project and I want to update a single record from the database to write code in my resource controller page.
Update records from resource controller in Laravel, try this code:
public static function update_records(Request $updata){ $data=array('name'=>$updata->name); $id=request()->segment(2); $sql=UpdatetModel::where('id',$id)->update($data); }