63 lines
1.7 KiB
PHP
63 lines
1.7 KiB
PHP
<?php
|
|
|
|
/**
|
|
* Created by Reliese Model.
|
|
*/
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Collection;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
/**
|
|
* Class Salutation
|
|
*
|
|
* @property int $id
|
|
* @property string $name
|
|
* @property Collection|Customer[] $customers
|
|
* @property Collection|Lead[] $leads
|
|
* @property Collection|LeadParticipant[] $lead_participants
|
|
* @property Collection|Participant[] $participants
|
|
* @package App\Models
|
|
* @property-read int|null $customers_count
|
|
* @property-read int|null $lead_participants_count
|
|
* @property-read int|null $leads_count
|
|
* @property-read int|null $participants_count
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Salutation newModelQuery()
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Salutation newQuery()
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Salutation query()
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Salutation whereId($value)
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Salutation whereName($value)
|
|
* @mixin \Eloquent
|
|
*/
|
|
class Salutation extends Model
|
|
{
|
|
protected $connection = 'mysql';
|
|
|
|
protected $table = 'salutation';
|
|
public $timestamps = false;
|
|
|
|
protected $fillable = [
|
|
'name'
|
|
];
|
|
|
|
public function customers()
|
|
{
|
|
return $this->hasMany(Customer::class);
|
|
}
|
|
|
|
public function leads()
|
|
{
|
|
return $this->hasMany(Lead::class, 'participant_salutation_id');
|
|
}
|
|
|
|
public function lead_participants()
|
|
{
|
|
return $this->hasMany(LeadParticipant::class, 'participant_salutation_id');
|
|
}
|
|
|
|
public function participants()
|
|
{
|
|
return $this->hasMany(Participant::class, 'participant_salutation_id');
|
|
}
|
|
}
|