<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class PlanTrabajo extends Model
{
    protected $table = 'crm_plan_trabajo';
    //
    public function apm(){
        return $this->hasOne('App\Apm', 'id', 'id_apm')->with('linea');
    }
    public function codigo_postal(){
        return $this->hasOne('App\CodigoPostal', 'id', 'id_codigo_postal')
                                    ->with('pais')
                                    ->with('departamento')
                                    ->with('municipio')
                                    ->with('region')
                                    ->with('gira')
                                    ->with('zona');
    }
    public function gira(){
        return $this->hasOne('App\Gira', 'id', 'id_gira')->with('region');
    }
}
