/** * List users. * * @return Response */ public function Users() { $users = $this->user->getUsers(); return view('Front::user.users', ['users' => $users]); }
<?php require_once '../classes/UserRepository.php'; header('Content-type: application/json'); //For security reasons, will be automatically stripped by AngularJS echo ")]}'\n"; $users = UserRepository::getUsers(); echo json_encode($users);