public static function readLog($deviceId, $page) { Paginator::currentPageResolver(function () use($page) { return $page; }); return CallLog::where('device_id', $deviceId)->orderBy('call_time', 'DESC')->simplePaginate(config('custom.item_per_page'))->all(); }
public function postLastCallLog() { $log = CallLog::where('device_id', $this->device->id)->orderBy('call_time', 'DESC')->first(); if (empty($log)) { return array(); } return $log; }