In a previous post, I asked about getting totals that turned out to be sum()values in Laravel. However, when the data is returned, it displays the sum without any other information that is usually displayed (for example: relationships, timestamps, etc.). Normally this would not be a problem if I just took the sum of everything as one number.
Below is a hard-coded example of visual recreation, and below is the data that creates it.

data: [{
period: '2016-04',
views: 2666,
}, {
period: '2016-05',
views: 2778,
}, {
period: '2016-06',
views: 4912,
}, {
period: '2016-07',
views: 3767,
}, {
period: '2016-08',
views: 6810,
}, {
period: '2016-09',
views: 5670,
}, {
period: '2016-10',
views: 4820,
}, {
period: '2016-11',
views: 15073,
}],
, , . , , , , , , , , created_at .
return Post::where('user_id', Auth::user()->id)->withCount(['visitors' => function($query)
{
$query->where('created_at', '<=', Carbon\Carbon::now())->where('created_at', '>=', Carbon\Carbon::yesterday());
}])->get()->sum('visitors_count');