public function __construct()
{
$this->cart = new CartHandler($this);
$this->order = new OrderHandler($this);
}
<?php
View::withCount(['orders', 'orders as total_orders' => function($query) {
$query->whereRaw('date(`modx_ms2_orders`.`createdon`) = date(`modx_site_partner_views`.`date`)');
}])
->where('partner_id', auth()->user()->partner_code)
->orderByDesc('id')
->paginate(10);
View::withCount('orders')
->where('partner_id', auth()->user()->partner_code)
->orderByDesc('id')
->paginate(10);