<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class AlumnoHistoricoPagos extends Model
{
	protected $table = 'alumno_historico_pagos';
  protected $fillable = ['fk_idLote','fk_idServicio','fk_idAlumno','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', 'fk_idLote', 'id')->orderBy('created_at','desc'); 
  }

  public function alumno(){ 
    return $this->belongsTo('App\Alumno', 'fk_idAlumno'); 
  }

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