%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/silvzytp/crm-ind-code/app/Models/
Upload File :
Create Path :
Current File : /home/silvzytp/crm-ind-code/app/Models/FreshLead.php

<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class FreshLead extends Model
{
    use HasFactory;

    /**
     * The attributes that aren't mass assignable.
     *
     * @var array
     */
    protected $guarded = [];

    public function agent(){
        return $this->belongsTo(User::class, 'agent_id','id');
    }

    public function createdBy(){
        return $this->belongsTo(User::class, 'created_by','id');
    }

    public function leadType()
    {
        return $this->belongsTo(LeadType::class, 'lead_type_id','id');
    }

    public function status()
    {
        return $this->belongsTo(CallingStatus::class, 'status_id','id');
    }

    public function subStatus()
    {
        return $this->belongsTo(CallingSubStatus::class, 'sub_status_id','id');
    }

    public function campaign()
    {
        return $this->belongsTo(Campaign::class, 'campaign_id','id');
    }

    public function category()
    {
        return $this->belongsTo(Category::class, 'category_id','id');
    }

    public function emirate()
    {
        return $this->belongsTo(Emirate::class, 'emirate_id','id');
    }

    public function source()
    {
        return $this->belongsTo(MarketingSource::class, 'marketing_source_id','id');
    }

    public function channel()
    {
        return $this->belongsTo(Channel::class, 'channel_id','id');
    }

    public function location()
    {
        return $this->belongsTo(Location::class, 'location_id','id');
    }

    public function subLocation()
    {
        return $this->belongsTo(SubLocation::class, 'sub_location_id','id');
    }

    public function comments(){
        return $this->hasMany(Comment::class, 'lead_id', 'id');
    }
}

Zerion Mini Shell 1.0