<?php

namespace App;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class Specialty extends Model 
{

    protected $table = 'specialties';
    public $timestamps = true;

    use SoftDeletes;

    protected $dates = ['deleted_at'];
    protected $fillable = array('name', 'cost_new', 'cost_continue', 'number_continue', 'number_absence', 'doctor_percentage', 'doctor_percentage_new');

    public function branches()
    {
        return $this->belongsToMany('App\SpecialtyBreanch');
    }

    public function train()
    {
        return $this->belongsToMany('App\SpecialtyTrain');
    }

    public function systemfood()
    {
        return $this->hasMany('App\SystemFood');
    }

    public function systemphysic()
    {
        return $this->hasMany('App\SystemPhysic');
    }

    public function medical()
    {
        return $this->hasMany('App\MedicalHistory');
    }

}