An error will be reported in TP5 debugging state
Undefined variable: data
public function editUser(Request $request)
{
//Get the data returned by the form
// $data = $request -> param();
$param = $request -> param();
//Remove the empty data in the form, that is, the data that has not been modified Content
foreach ($param as $key => $value ){
if (!empty($value)){
# }
$condition = ['id'=>$data['id']] ; ;
; ## Session::set('user_info.role', $data['role']);
}
use using using use using ’s ’ using using ’ s ’ through using ’s ’ through ‐ to ‐ ‐‐‐‐‐ and to >
}
}
if($request->param('name')=='admin')
{
Session::set('user_info.role',$data['role']);
}
Change it to this
Define data at the front of the method and assign it to empty