call = $call; $this->meeting = $meeting; $this->task = $task; $this->attendee = $attendee; $this->calendar = $calendar; } /** * Returns count of activity. * * @param array $filter * * @return int */ public function count() { return 0; } /** * Make gadget View * * @param string $view * * @param int $count * * @return View */ public function gadget($view = 'admin.call.gadget', $count = 10) { if (User::hasRole('user')) { $this->call->pushCriteria(new \Litepie\Bixo\Repositories\Criteria\CallUserCriteria()); } $call = $this->call->scopeQuery(function ($query) use ($count) { return $query->orderBy('id', 'DESC')->take($count); })->all(); return view('activity::' . $view, compact('call'))->render(); } /** * Make gadget View * * @param string $view * * @param int $count * * @return View */ public function gadget($view = 'admin.meeting.gadget', $count = 10) { if (User::hasRole('user')) { $this->meeting->pushCriteria(new \Litepie\Bixo\Repositories\Criteria\MeetingUserCriteria()); } $meeting = $this->meeting->scopeQuery(function ($query) use ($count) { return $query->orderBy('id', 'DESC')->take($count); })->all(); return view('activity::' . $view, compact('meeting'))->render(); } /** * Make gadget View * * @param string $view * * @param int $count * * @return View */ public function gadget($view = 'admin.task.gadget', $count = 10) { if (User::hasRole('user')) { $this->task->pushCriteria(new \Litepie\Bixo\Repositories\Criteria\TaskUserCriteria()); } $task = $this->task->scopeQuery(function ($query) use ($count) { return $query->orderBy('id', 'DESC')->take($count); })->all(); return view('activity::' . $view, compact('task'))->render(); } /** * Make gadget View * * @param string $view * * @param int $count * * @return View */ public function gadget($view = 'admin.attendee.gadget', $count = 10) { if (User::hasRole('user')) { $this->attendee->pushCriteria(new \Litepie\Bixo\Repositories\Criteria\AttendeeUserCriteria()); } $attendee = $this->attendee->scopeQuery(function ($query) use ($count) { return $query->orderBy('id', 'DESC')->take($count); })->all(); return view('activity::' . $view, compact('attendee'))->render(); } /** * Make gadget View * * @param string $view * * @param int $count * * @return View */ public function gadget($view = 'admin.calendar.gadget', $count = 10) { if (User::hasRole('user')) { $this->calendar->pushCriteria(new \Litepie\Bixo\Repositories\Criteria\CalendarUserCriteria()); } $calendar = $this->calendar->scopeQuery(function ($query) use ($count) { return $query->orderBy('id', 'DESC')->take($count); })->all(); return view('activity::' . $view, compact('calendar'))->render(); } }