dbfdg data); $link = '#'; $icon = 'fa fa-bell'; $icon_color = 'bg-primary'; $text = ''; if(isset($data->updated_by) && !empty($data->updated_by)) { $usr = User::find($data->updated_by); } if(!empty($usr)) { // For Deals Notification if($this->type == 'assign_deal') { $link = route('deals.show', [$data->deal_id,]); $text = $usr->name . " " . __('Added you') . " " . __('in deal') . " " . $data->name . " "; $icon = "fa fa-plus"; $icon_color = 'bg-primary'; } if($this->type == 'create_deal_call') { $link = route('deals.show', [$data->deal_id,]); $text = $usr->name . " " . __('Create new Deal Call') . " " . __('in deal') . " " . $data->name . " "; $icon = "fa fa-phone"; $icon_color = 'bg-info'; } if($this->type == 'update_deal_source') { $link = route('deals.show', [$data->deal_id,]); $text = $usr->name . " " . __('Update Sources') . " " . __('in deal') . " " . $data->name . " "; $icon = "fa fa-file-alt"; $icon_color = 'bg-warning'; } if($this->type == 'create_task') { $link = route('deals.show', [$data->deal_id,]); $text = $usr->name . " " . __('Create new Task') . " " . __('in deal') . " " . $data->name . " "; $icon = "fa fa-tasks"; $icon_color = 'bg-primary'; } if($this->type == 'add_product') { $link = route('deals.show', [$data->deal_id,]); $text = $usr->name . " " . __('Add new Products') . " " . __('in deal') . " " . $data->name . " "; $icon = "fa fa-dolly"; $icon_color = 'bg-danger'; } if($this->type == 'add_discussion') { $link = route('deals.show', [$data->deal_id,]); $text = $usr->name . " " . __('Add new Discussion') . " " . __('in deal') . " " . $data->name . " "; $icon = "fa fa-comments"; $icon_color = 'bg-info'; } if($this->type == 'move_deal') { $link = route('deals.show', [$data->deal_id,]); $text = $usr->name . " " . __('Moved the deal') . " " . $data->name . " " . __('from') . " " . __(ucwords($data->old_status)) . " " . __('to') . " " . __(ucwords($data->new_status)); $icon = "fa fa-arrows-alt"; $icon_color = 'bg-primary'; } // end deals // for estimations if($this->type == 'assign_estimation') { $link = route('estimations.show', [$data->estimation_id,]); $text = $usr->name . " " . __('Added you') . " " . __('in estimation') . " " . $data->estimation_name . " "; $icon = "fa fa-plus"; $icon_color = 'bg-primary'; } // end estimations // For Leads Notification if($this->type == 'assign_lead') { $link = route('leads.show', [$data->lead_id,]); $text = $usr->name . " " . __('Added you') . " " . __('in lead') . " " . $data->name . " "; $icon = "fa fa-plus"; $icon_color = 'bg-primary'; } if($this->type == 'create_lead_call') { $link = route('leads.show', [$data->lead_id,]); $text = $usr->name . " " . __('Create new Lead Call') . " " . __('in lead') . " " . $data->name . " "; $icon = "fa fa-phone"; $icon_color = 'bg-info'; } if($this->type == 'update_lead_source') { $link = route('leads.show', [$data->lead_id,]); $text = $usr->name . " " . __('Update Sources') . " " . __('in lead') . " " . $data->name . " "; $icon = "fa fa-file-alt"; $icon_color = 'bg-warning'; } if($this->type == 'add_lead_product') { $link = route('leads.show', [$data->lead_id,]); $text = $usr->name . " " . __('Add new Products') . " " . __('in lead') . " " . $data->name . " "; $icon = "fa fa-dolly"; $icon_color = 'bg-danger'; } if($this->type == 'add_lead_discussion') { $link = route('leads.show', [$data->lead_id,]); $text = $usr->name . " " . __('Add new Discussion') . " " . __('in lead') . " " . $data->name . " "; $icon = "fa fa-comments"; $icon_color = 'bg-info'; } if($this->type == 'move_lead') { $link = route('leads.show', [$data->lead_id,]); $text = $usr->name . " " . __('Moved the lead') . " " . $data->name . " " . __('from') . " " . __(ucwords($data->old_status)) . " " . __('to') . " " . __(ucwords($data->new_status)); $icon = "fa fa-arrows-alt"; $icon_color = 'bg-primary'; } // end Leads $date = $this->created_at->diffForHumans(); $html = '
' . $text . '
' . $date . '
'; } else { $html = ''; } return $html; } }