sidebar_position |
---|
4 |
Guild is a Customer relationship management package that allows the user to manage his leads and deals, similar to a guild that manages its members and their assignments, as well as the reports and plans related to them.
Providing methods to manage and get leads and CRM related functions.
/**
* Create a new Lead
*
* @param UserInterface $user
* @param string $title
* @param ModelsStages $pipelineStage
* @param LeadsRotationsAgents $agent
* @param Organizations $organization
* @param Types $leadType
* @param Status $leadStatus
* @param Source $leadSource
* @param boolean $isDuplicate
* @param string $description
* @return ModelsLeads
*/
$leads = Leads::create(
$user,
$title,
$modelPipelineStage,
$leadRotationsAgent,
$organization,
$leadType,
$leadStatus,
$leadSource,
$isDuplicate,
$descriptions
);
$data = [
'request' => 'Request Data',
'ip' => '123.456.789',
'header' => 'Request Header',
'source' => 'Source',
'public_key' => 'Key',
'processed' => 0,
]
/**
* Create a new lead attempt
*
* @param UserInterface $user
* @param array $data
* @param Leads|null $lead
* @return ModelAttempts
*/
Leads::attempt($user, $data, $lead);
// find a lead by id
$lead = Leads::getById(4, $user);
$lead->Title = 'new Title';
$lead->saveOrFail();
//Get all the leads
$page = 1;
$limit = 10;
$leads = Leads::getAll($user, $page, $limit);
//Get Leads by id
$leads = Leads::getById(4);
//Get leads by status
$leads = Leads::getByStatus(LeadStatus::LOSE, $user, $page, $limit);
$leads = Leads::getByStatus(LeadStatus::WIN, $user, $page, $limit);
//Create a new organization by an array of data
$organization = Organization::create($data, $user);
$organization = Organization::getById(3, $user);
Organization::update($organization, $data);
OR
$organization = Organization::getById(3)->update($data);
//Get Organization by its id
$organization = Organization::getById(3, $user);
//Get All organization
$page = 1;
$limit = 10;
$organization = Organization::getAll($user, $page, $limit);
//Get the people and the organization
$people = Peoples::getById(3);
$organization = Organization::getById(3, $user);
// Add a new people to an organization
Organization::addPeople($organization, $people);
Or
$organization = Organization::getById(3);
$organization->addPeople($people);
$organization = Organization::getById(3);
$organization->getPeoples();
$data = [
'name' => 'Romeo',
'email' => 'Romeo@mail.com'
];
$people = People::create($data, $user)
$people = People::getById(1, $user);
$people->name = 'New juan';
$people->saveOrFail();
Or
$people = People::getById(1, $user)->update($data);
// @people People user data for the new contact
// @contactType
Contacts::createNewContact($people, $contactType, $value);
$lead = Lead::getById(1, $user);
$newDeal = Deal::create($user, $lead)
$lead = Lead::getById(1, $user);
$deal = $lead->getDeal();
$deal = Deal::getById(2, $user);
$page = 1;
$limit = 10;
$deal = Deal::getAll($user, $page, $limit);
Deal::update(Deal::getById(2), $data);
$pipelines = Pipelines::create($name, $entity, $user);
$page = 1;
$limit = 10;
$pipelines = Pipelines::getAll($user, $page, $limit);
Or
$pipeline = Pipelines::getById($name);
$pipeline = Pipelines::getById(1);
Pipelines::update($pipeline, $name);
// $pipeline Pipeline Object
// $name string
// $hasRotting boolean
// $rottingDays int
Pipelines::createStage($pipeline, $name, $hasRotting, $rottingDays);
$pipelineStage = Pipelines::getStageById(1);
Or
$pipelineStage = Pipelines::getStagesByPipeline($pipeline);
$pipelineStage = Pipelines::getStageById(1);
Pipelines::updateStage($pipelineStage, $data)
$pipelines = Rotations::create($name, $user);
$rotation = Rotations::getById(1);
Rotations::update($rotation, $name);
$rotation = Rotations::getById(1, $user);
$rotation = Rotation::getByName($name, $user);
Agents::create($rotation, $user, $receiver, $percent, $hits);
Agents::getAllAgents($rotation, $page, $limit);
Agents::getAgentsFromRotation($rotation, $page, $limit);
Agents::getAgentById(2, $user);
$agent = Rotation::getAgentById(2, $user);
Rotations::update($agent, $data);
Rotation::getAgent($rotation);
$activity = Activities::create(
$user,
"Title",
$startDate,
$endDate,
$lead,
$activityType,
$isComplete,
$appId
);
$type = Activities::createType($user, $name, $description);
$activityEdited = Activities::update($activity, $data);
// Get activity by id
Activities::getById(1, $user);
// Get all activities
Activities::getAll($user, $page, $limit);
// Get leads activities
$lead = Leads::getById(1);
$lead->getActivities();