I have some problems with getting time on my app. I'm using laravel api to send informations to my React app. I have controller like:
public function index(){
$user = auth()->user();
$servers = Server::where('clientid', $user->id)
->orderBy('id', 'desc')
->take(10)
->get();
if ($user) {
$reposne['result'] = true;
$reposne['servers'] = $servers;
} else {
return response()->json(['error' => 'Unauthorized'], 401);
}
return $reposne;
}
And it's successfuly returns what I need, like:
{
"result": true,
"servers": [
{
"id": 2512,
"clientid": 4,
"boxid": 23,
"ipid": 60,
"vazido": 1584355476,
"created_at": null,
"updated_at": null,
"status": "Active"
}
]
}
But as you see there is column vazido that is actyally giving a timestamp. How can I make this time to actual human format?