Hello, How to return Json Data from function in controller to view Here is function
public function getLoginDetails($dIdLogin)
{
$dIdAgent = \Authorize::getCurrentAgent();
$oCheck = UserAgent::where('id_user', '=', $dIdAgent)
->where('id_mt4_user', '=', $dIdLogin)
->first();
if ($oCheck) {
$oMt4Login = Mt4User::where('LOGIN', '=', $dIdLogin)->first();
$aResult = array(
'LOGIN' => $oMt4Login->LOGIN,
'GROUP' => $oMt4Login->GROUP,
'NAME' => $oMt4Login->NAME,
'COUNTRY' => $oMt4Login->COUNTRY,
'CITY' => $oMt4Login->CITY,
);
return JsonResponse::create($aResult);
}
Thanks
Thanks micanzhang but how to show this in view ex show in table
do you want login via ajax request? or you just want echo json format to html? i don't get it, or ?
return Response::make('view', ['data'=>json_encode($aResult)]):
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community