company = $company; $this->calendar = $calendar; $this->calendar_event = $calendar_event; $this->calendar_event_status = $calendar_event_status; $this->calendar_event_priority = $calendar_event_priority; $this->relation = $relation; $this->relation_type = $relation_type; $this->relation_status = $relation_status; $this->lead = $lead; $this->lead_source = $lead_source; $this->opportunity = $opportunity; $this->opportunity_status = $opportunity_status; $this->vendor = $vendor; $this->customer = $customer; $this->relation_address = $relation_address; $this->relation_communication = $relation_communication; } /** * Returns count of advancedcrm. * * @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.company.gadget', $count = 10) { if (User::hasRole('user')) { $this->company->pushCriteria(new \Litepie\Cleancrm\Repositories\Criteria\CompanyUserCriteria()); } $company = $this->company->scopeQuery(function ($query) use ($count) { return $query->orderBy('id', 'DESC')->take($count); })->all(); return view('advancedcrm::' . $view, compact('company'))->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\Cleancrm\Repositories\Criteria\CalendarUserCriteria()); } $calendar = $this->calendar->scopeQuery(function ($query) use ($count) { return $query->orderBy('id', 'DESC')->take($count); })->all(); return view('advancedcrm::' . $view, compact('calendar'))->render(); } /** * Make gadget View * * @param string $view * * @param int $count * * @return View */ public function gadget($view = 'admin.calendar_event.gadget', $count = 10) { if (User::hasRole('user')) { $this->calendar_event->pushCriteria(new \Litepie\Cleancrm\Repositories\Criteria\CalendarEventUserCriteria()); } $calendar_event = $this->calendar_event->scopeQuery(function ($query) use ($count) { return $query->orderBy('id', 'DESC')->take($count); })->all(); return view('advancedcrm::' . $view, compact('calendar_event'))->render(); } /** * Make gadget View * * @param string $view * * @param int $count * * @return View */ public function gadget($view = 'admin.calendar_event_status.gadget', $count = 10) { if (User::hasRole('user')) { $this->calendar_event_status->pushCriteria(new \Litepie\Cleancrm\Repositories\Criteria\CalendarEventStatusUserCriteria()); } $calendar_event_status = $this->calendar_event_status->scopeQuery(function ($query) use ($count) { return $query->orderBy('id', 'DESC')->take($count); })->all(); return view('advancedcrm::' . $view, compact('calendar_event_status'))->render(); } /** * Make gadget View * * @param string $view * * @param int $count * * @return View */ public function gadget($view = 'admin.calendar_event_priority.gadget', $count = 10) { if (User::hasRole('user')) { $this->calendar_event_priority->pushCriteria(new \Litepie\Cleancrm\Repositories\Criteria\CalendarEventPriorityUserCriteria()); } $calendar_event_priority = $this->calendar_event_priority->scopeQuery(function ($query) use ($count) { return $query->orderBy('id', 'DESC')->take($count); })->all(); return view('advancedcrm::' . $view, compact('calendar_event_priority'))->render(); } /** * Make gadget View * * @param string $view * * @param int $count * * @return View */ public function gadget($view = 'admin.relation.gadget', $count = 10) { if (User::hasRole('user')) { $this->relation->pushCriteria(new \Litepie\Cleancrm\Repositories\Criteria\RelationUserCriteria()); } $relation = $this->relation->scopeQuery(function ($query) use ($count) { return $query->orderBy('id', 'DESC')->take($count); })->all(); return view('advancedcrm::' . $view, compact('relation'))->render(); } /** * Make gadget View * * @param string $view * * @param int $count * * @return View */ public function gadget($view = 'admin.relation_type.gadget', $count = 10) { if (User::hasRole('user')) { $this->relation_type->pushCriteria(new \Litepie\Cleancrm\Repositories\Criteria\RelationTypeUserCriteria()); } $relation_type = $this->relation_type->scopeQuery(function ($query) use ($count) { return $query->orderBy('id', 'DESC')->take($count); })->all(); return view('advancedcrm::' . $view, compact('relation_type'))->render(); } /** * Make gadget View * * @param string $view * * @param int $count * * @return View */ public function gadget($view = 'admin.relation_status.gadget', $count = 10) { if (User::hasRole('user')) { $this->relation_status->pushCriteria(new \Litepie\Cleancrm\Repositories\Criteria\RelationStatusUserCriteria()); } $relation_status = $this->relation_status->scopeQuery(function ($query) use ($count) { return $query->orderBy('id', 'DESC')->take($count); })->all(); return view('advancedcrm::' . $view, compact('relation_status'))->render(); } /** * Make gadget View * * @param string $view * * @param int $count * * @return View */ public function gadget($view = 'admin.lead.gadget', $count = 10) { if (User::hasRole('user')) { $this->lead->pushCriteria(new \Litepie\Cleancrm\Repositories\Criteria\LeadUserCriteria()); } $lead = $this->lead->scopeQuery(function ($query) use ($count) { return $query->orderBy('id', 'DESC')->take($count); })->all(); return view('advancedcrm::' . $view, compact('lead'))->render(); } /** * Make gadget View * * @param string $view * * @param int $count * * @return View */ public function gadget($view = 'admin.lead_source.gadget', $count = 10) { if (User::hasRole('user')) { $this->lead_source->pushCriteria(new \Litepie\Cleancrm\Repositories\Criteria\LeadSourceUserCriteria()); } $lead_source = $this->lead_source->scopeQuery(function ($query) use ($count) { return $query->orderBy('id', 'DESC')->take($count); })->all(); return view('advancedcrm::' . $view, compact('lead_source'))->render(); } /** * Make gadget View * * @param string $view * * @param int $count * * @return View */ public function gadget($view = 'admin.opportunity.gadget', $count = 10) { if (User::hasRole('user')) { $this->opportunity->pushCriteria(new \Litepie\Cleancrm\Repositories\Criteria\OpportunityUserCriteria()); } $opportunity = $this->opportunity->scopeQuery(function ($query) use ($count) { return $query->orderBy('id', 'DESC')->take($count); })->all(); return view('advancedcrm::' . $view, compact('opportunity'))->render(); } /** * Make gadget View * * @param string $view * * @param int $count * * @return View */ public function gadget($view = 'admin.opportunity_status.gadget', $count = 10) { if (User::hasRole('user')) { $this->opportunity_status->pushCriteria(new \Litepie\Cleancrm\Repositories\Criteria\OpportunityStatusUserCriteria()); } $opportunity_status = $this->opportunity_status->scopeQuery(function ($query) use ($count) { return $query->orderBy('id', 'DESC')->take($count); })->all(); return view('advancedcrm::' . $view, compact('opportunity_status'))->render(); } /** * Make gadget View * * @param string $view * * @param int $count * * @return View */ public function gadget($view = 'admin.vendor.gadget', $count = 10) { if (User::hasRole('user')) { $this->vendor->pushCriteria(new \Litepie\Cleancrm\Repositories\Criteria\VendorUserCriteria()); } $vendor = $this->vendor->scopeQuery(function ($query) use ($count) { return $query->orderBy('id', 'DESC')->take($count); })->all(); return view('advancedcrm::' . $view, compact('vendor'))->render(); } /** * Make gadget View * * @param string $view * * @param int $count * * @return View */ public function gadget($view = 'admin.customer.gadget', $count = 10) { if (User::hasRole('user')) { $this->customer->pushCriteria(new \Litepie\Cleancrm\Repositories\Criteria\CustomerUserCriteria()); } $customer = $this->customer->scopeQuery(function ($query) use ($count) { return $query->orderBy('id', 'DESC')->take($count); })->all(); return view('advancedcrm::' . $view, compact('customer'))->render(); } /** * Make gadget View * * @param string $view * * @param int $count * * @return View */ public function gadget($view = 'admin.relation_address.gadget', $count = 10) { if (User::hasRole('user')) { $this->relation_address->pushCriteria(new \Litepie\Cleancrm\Repositories\Criteria\RelationAddressUserCriteria()); } $relation_address = $this->relation_address->scopeQuery(function ($query) use ($count) { return $query->orderBy('id', 'DESC')->take($count); })->all(); return view('advancedcrm::' . $view, compact('relation_address'))->render(); } /** * Make gadget View * * @param string $view * * @param int $count * * @return View */ public function gadget($view = 'admin.relation_communication.gadget', $count = 10) { if (User::hasRole('user')) { $this->relation_communication->pushCriteria(new \Litepie\Cleancrm\Repositories\Criteria\RelationCommunicationUserCriteria()); } $relation_communication = $this->relation_communication->scopeQuery(function ($query) use ($count) { return $query->orderBy('id', 'DESC')->take($count); })->all(); return view('advancedcrm::' . $view, compact('relation_communication'))->render(); } }