<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;


/**
 * App\Models\TravelClass
 *
 * @property int $id
 * @property string|null $name
 * @property string|null $description
 * @property int|null $program_id
 * @property int $standard
 * @property \Illuminate\Support\Carbon|null $created_at
 * @property \Illuminate\Support\Carbon|null $updated_at
 * @property-read \App\Models\TravelProgram|null $travel_program
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelClass whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelClass whereDescription($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelClass whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelClass whereName($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelClass whereProgramId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelClass whereStandard($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelClass whereUpdatedAt($value)
 * @mixin \Eloquent
 * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\TravelProgramDraft[] $travel_program_drafts
 */
class TravelClass extends Model
{
    //use the connection to sec. Datebase sterntours
    protected $connection = 'mysql_stern';

    protected $table = 'travel_class';

    protected $fillable = [
        'program_id',
        'name',
        'description',
        'standard',
    ];

    public function travel_program()
    {
        return $this->belongsTo('App\Models\TravelProgram', 'program_id');
    }

    public function travel_program_drafts()
    {
        return $this->hasMany('App\Models\TravelProgramDraft', 'travel_class_id', 'id');
    }
}
