DHIS2 Login using Laravel and CURL


public function dhis2Login(Request $request) {	

	$username = trim($request->input('username'));
	$password = trim($request->input('password'));
	$ch = curl_init("http://........:8080/api/me");
	curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
	curl_setopt($ch, CURLOPT_USERPWD, "admin:district");
	$status_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);   //get status code
	$result=curl_exec ($ch);
	curl_close ($ch);
	$data['resultData']= json_decode($result, true);

}