first_name . ' ' . $lead->last_name; // $lead->full_name = $fullName; // }); // static::saved(function (Lead $lead) { // $leadEmailService = App::make(LeadEmailService::class); // $leadEmailService->manageLeadEmail($lead); // }); } protected static function booted() { // static::created(function (Lead $lead) { // $fullName = $lead->first_name . ' ' . $lead->last_name; // $lead->full_name = $fullName; // $lead->save(); // $lead->update(); // }); } /** * Validation rules * * @var array */ public static $rules = [ ]; // protected static $logAttributes = [ // 'msgId', // 'msg', // 'smsLength', // 'smsCost', // 'receiver', // 'senttime', // 'status', // 'notes', // 'isDone', // 'ownedBy.name', // 'lead.name', // 'contact.name', // 'account.name', // 'campaign.name', // ]; public $table = 'sms_msg'; public $fillable = [ 'msgId', 'msg', 'smsLength', 'smsCost', 'receiver', 'senttime', 'smstype', 'status', 'notes', 'isDone', 'lead_id', 'contact_id', 'account_id', 'campaign_id', ]; protected $mustBeApproved = false; protected $dates = ['deleted_at', 'created_at', 'updated_at', 'senttime']; /** * The attributes that should be casted to native types. * * @var array */ // protected $casts = [ // 'id' => 'integer', // 'name' => 'string', // ]; /** * @param Model $model * @param string $attribute * @return array */ protected static function getRelatedModelAttributeValue(Model $model, string $attribute): array { return ActivityLogHelper::getRelatedModelAttributeValue($model, $attribute); } /** * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ public function lead() { return $this->belongsTo(Lead::class); } /** * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ public function account() { return $this->belongsTo(Account::class); } /** * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ public function contact() { return $this->belongsTo(Contact::class); } public function smsSender() { return $this->belongsTo(SmsSender::class); } /** * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ public function campaign() { return $this->belongsTo(Campaign::class); } }