/** * get the identifiers of all activity * @param $orgId * @return array */ public function getIdentifiers($orgId) { $activities = $this->activity->where('organization_id', $orgId)->get(); $identifiers = []; foreach ($activities as $activityRow) { $identifiers[$activityRow->identifier['activity_identifier']] = $activityRow->id; } return $identifiers; }
/** * get identifier except activityId of an organization * @param $activityId * @return mixed */ public function getActivityIdentifiersForOrganizationExcept($activityId) { return $this->activity->where(function ($query) use($activityId) { $query->where('id', '<>', $activityId)->where('organization_id', '=', session('org_id')); })->get(['identifier']); }
/** * @param $organization_id * @return mixed */ protected function getActivities($organization_id) { return $this->activity->where('organization_id', $organization_id)->get(); }