IMMREX7
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
use Carbon\Carbon;
class RollbackBusTransaction extends Model {
protected $primaryKey = 'idRollback';
protected $table = 'student_rollback_transaction_bus';
protected $fillable = ['receiptNo', 'idSchool', 'idFinancialYear', 'paymentDate','idBusLesserTransaction','idBusTransaction',
'fine', 'idStudent', 'paymentMode', 'discount', 'totalPaid', 'penaltyAmount',
'penaltyRemarks', 'remarks','cardNo', 'chequeBounceCharge','idBank', 'status', 'chequeNo', 'chequeDate','idOutstanding','outstandingAmount','bankName'];
public function student() {
return $this->belongsTo(AdmEntry::class, 'idStudent', 'idStudent');
}
public function feehead() {
return $this->belongsTo(FeeHead::class, 'idFeehead', 'idFeehead');
}
public function setPaymentDateAttribute($date) {
if (strlen($date) > 0)
$this->attributes['paymentDate'] = Carbon::createFromFormat('d-m-Y', $date);
else
$this->attributes['paymentDate'] = null;
}
public function getPaymentDateAttribute($date) {
if ($date && $date != '0000-00-00' && $date != 'null')
return Carbon::parse($date)->format('d-m-Y');
return '';
}
public function setChequeDateAttribute($date) {
if (strlen($date) > 0)
$this->attributes['chequeDate'] = Carbon::createFromFormat('d-m-Y', $date);
else
$this->attributes['chequeDate'] = null;
}
public function getChequeDateAttribute($date) {
if ($date && $date != '0000-00-00' && $date != 'null')
return Carbon::parse($date)->format('d-m-Y');
return '';
}
public function feechq() {
return $this->belongsTo(StdfeeCheque::class, 'idStdCheque', 'idStdCheque');
}
public function details() {
return $this->hasMany(StudentTransactionDetail::class, 'idTransaction', 'idTransaction');
}
}
Copyright © 2021 -