<?php

namespace App\Models\LeadSource;

use App\Models\Client\Client;
use App\Trait\BelongsToSolicitor;
use App\Trait\HasSlug;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class LeadSource extends Model {

    protected $table = 'lead_sources';

    protected $fillable = [
        'solicitor_id',
        'slug',
        'display_name',
        'status'
    ];

    use BelongsToSolicitor, HasSlug, SoftDeletes, HasFactory;

    public function endpoints() {
        return $this->hasMany(LeadSourceEndpoint::class);
    }

    public function leads() {
        return $this->hasMany(Client::class);
    }
}
