<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class AspiranteHistoricoPagos extends Model
{
    protected $table = 'aspirante_historico_pagos';
  	protected $fillable = ['fk_idLote','fk_idServicio','fk_idAspirante','fk_idFormaPago','fk_idPeriodo','fk_idAutorizo','fk_idEstado','importe','referencia','imagen','fecha_pago','fecha_autorizado','consecutivo'];
  	protected $dates = ['fecha_pago','fecha_autorizado'];

  	public function observaciones(){ 
  		return $this->hasMany('App\ObservacionPago',  'id', 'fk_idLote')->orderBy('created_at','desc'); 
  	}

	public function aspirante(){ 
		return $this->belongsTo('App\Aspirante', 'fk_idAspirante'); 
	}
	
	public function lote(){ 
		return $this->belongsTo('App\LotePagos', 'fk_idLote'); 
	}
}
