I am making http requests to a laravel route, but I need the result of the request not to be shown when accessing the route, for example if I get the users with the route / getUsers the data is displayed as follows
{
"id":1,
"name":"Usuario1",
"email":"[email protected]",
"facebook_id":null,
"created_at":"2018-11-16 10:19:41",
"updated_at":"2018-11-16 10:19:41"
}
How could I ensure that the data is not displayed when accessing the route / getUser?
I tried with if(!$request->ajax())return redirect('/');
and when accessing the route redirects me but from the view does not kill anything.