<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

/**
 * App\Models\TravelAgenda
 *
 * @property int $id
 * @property string $name
 * @property int|null $travelcountry_id
 * @property int|null $active
 * @property-read \App\Models\TravelCountry|null $travel_country
 * @property-read \App\Models\Sym\TravelCountry|null $travel_country_crm
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelAgenda whereActive($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelAgenda whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelAgenda whereName($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelAgenda whereTravelcountryId($value)
 * @mixin \Eloquent
 */
class TravelAgenda extends Model
{
    protected $connection = 'mysql';

    protected $table = 'travel_agenda';

    protected $fillable = [
        'name',
        'travelcountry_id',
        'active'

    ];

    public $timestamps = false;

    //on crm
    public function travel_country_crm()
    {
        return $this->belongsTo('App\Models\Sym\TravelCountry', 'travelcountry_id', 'id');
    }


    //on stern other DB
    public function travel_country()
    {
        return $this->belongsTo('App\Models\TravelCountry', 'travelcountry_id', 'crm_id');
    }

}