Question is quite simple, I am using dingo
package, Currently below is my code for an API call.
public function publishApplicant(Request $request,$id){
$changeStatus = \App\User::where('id', $id)->update(array('admin_published' => 1));
if($changeStatus){
return response()->json([
'message' => 'Applicant published.',
'code' => 200,
'status' => 1
], 200);
}
return response()->json([
'message' => 'Applicant published.',
'code' => 500,
'status' => 0
], 200);
}
What can be improved in the above code?