IMMREX7

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

<?php

namespace App;

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

class EmployeeNoticeboard extends Model {

    protected $primaryKey = 'idEmployeeNoticeboard';
    protected $table = 'noticeboard_employee';
    protected $fillable = ['idDepartment', 'idFinancialYear', 'idSchool', 'idDesignation', 'cardholder', 'subject', 'notice', 'noticeFile', 'isPublished', 'publishDate'];

    /*public function classM() {
        return $this->belongsTo(ClassM::class, 'idClass', 'idClass');
    }

    public function section() {
        return $this->belongsTo(Section::class, 'idSection', 'idSection');
    }

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

    public function setPublishDateAttribute($date) {
        if (strlen($date) > 0)
            $this->attributes['publishDate'] = Carbon::createFromFormat('d-m-Y', $date);
        else
            $this->attributes['publishDate'] = null;
    }

    public function getPublishDateAttribute($date) {
        if ($date && $date != '0000-00-00' && $date != 'null')
            return Carbon::parse($date)->format('d-m-Y');
        return '';
    }

}

Copyright © 2021 - 2025 IMMREX7