IMMREX7

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

<?php

namespace App;

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

class RollbackTransactionDetails extends Model {

    protected $primaryKey = 'idRollbackDetail';
    protected $table = 'student_rollback_details';
    protected $fillable = ['idTransaction', 'idStudent','idLesserTransaction', 'idFeehead', 'amountPaid', 'discount', 'fine','status','paymentDate','chqPenalty'];

    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 feehead() {
        return $this->belongsTo(FeeHead::class, 'idFeehead', 'idFeehead');
    }
    public function north_feehead() {
        return $this->belongsTo(NorthFeeHead::class, 'idFeehead', 'idFeehead');
    }

}

Copyright © 2021 - 2025 IMMREX7