location / {
proxy_cache all;
proxy_cache_valid any 1h;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header HTTPS YES;
proxy_pass http://127.0.0.1:5443/;
}
# параметры https
fastcgi_param HTTPS on;
fastcgi_param HTTP_HTTPS on;
fastcgi_param REQUEST_SCHEME https;
fastcgi_param SERVER_PORT 443;
}
.....
/*
Show Event View by event Identify
*/
public function getEvent($id)
{
$event = Event::with([
'event_diplomas'=>function($query)
{
$query->select('id', 'event_id', 'name');
}
])->where("id", '=', $id)->firstOrFail();
dd($event);
}
.....
if($_POST['dataType']=="giveMeJSON"){
... собираете массив и формируете из него джейсон
}else{
... выводите данные в html (если вы это хотели)
}