IMMREX7

aku nok ndi : /home/spdtg/www/schoolmis/app/
File Up :
aku nok ndi : /home/spdtg/www/schoolmis/app/BusFailedTransaction.php

<?php

namespace App;

use Illuminate\Database\Eloquent\Model;
use Carbon\Carbon;

class BusFailedTransaction extends Model
{
    protected $primaryKey = 'idBusFailedTransaction';
    protected $table = 'bus_failed_transaction';
    protected $fillable = ['receiptNo', 'idSchool', 'idFinancialYear', 'paymentDate',
        'fine', 'idStudent', 'paymentMode', 'discount', 'totalPaid', 'penaltyAmount',
        'penaltyRemarks', 'remarks', 'cardNo', 'chequeBounceCharge', 'idBank', 'status', 'chequeNo', 'chequeDate'];

    public function student() {
        return $this->belongsTo(AdmEntry::class, 'idStudent', 'idStudent');
    }

    public function feehead() {
        return $this->belongsTo(BusFeehead::class, 'idBusFeehead', 'idBusFeehead');
    }

    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(BusLesserTransactionDetail::class, 'idBusLesserTransaction', 'idBusLesserTransaction');
    }

    public function bank() {
        return $this->belongsTo(Bank::class, 'idBank', 'idBank');
    }

}

Copyright © 2021 - 2025 IMMREX7