Пример #1
0
 /**
  * @author bigsinoos <*****@*****.**>
  * Delete lead phone number
  *
  * @param $toBeDeleted
  * @return mixed
  */
 public function deleteLeadPhones(Lead $toBeDeleted)
 {
     $deleteQueue = $toBeDeleted->phones()->get();
     foreach ($deleteQueue as $item) {
         $item->delete();
     }
 }
Пример #2
0
 /**
  * @author bigsinoos <*****@*****.**>
  * Add relationships to a lead
  *
  * @param Lead $lead
  * @return \Illuminate\Database\Eloquent\Collection|static[]
  */
 public function getAllForLead(Lead $lead)
 {
     return $lead->load('phones', 'tags');
 }
Пример #3
0
 /**
  * @author bigsinoos <*****@*****.**>
  * Add a tag model to a lead
  *
  * @param $lead
  * @param $tag
  * @return mixed
  */
 public function addTagToLead(Lead $lead, Tag $tag)
 {
     $lead->tags()->attach($tag);
     return $lead;
 }