Your IP : 216.73.216.91


Current Path : /var/www/html/LLCF-APP/app/Models/
Upload File :
Current File : /var/www/html/LLCF-APP/app/Models/Student.php

<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;

class Student extends Model
{
    protected $table = 'student';

    public $timestamps = false;

    const CREATED_AT = 'created_on';
    const UPDATED_AT = 'updated_on';

    protected $fillable = [
        'stu_full_name',
        'stu_dob',
        'stu_gender',
        'gr_num',
        'auto_gr_num',
        'class',
        'family_id',
        'donor_id',
        'donation_date',
        'donation_expiry',
        'created_on',
        'updated_on',
    ];

    public function family(): BelongsTo
    {
        return $this->belongsTo(Family::class, 'family_id');
    }

    public function donor(): BelongsTo
    {
        return $this->belongsTo(Donor::class, 'donor_id');
    }

    public function attendances(): HasMany
    {
        return $this->hasMany(Attendance::class);
    }

    public function studentServices(): HasMany
    {
        return $this->hasMany(StudentService::class);
    }

    public function healthRecords(): HasMany
    {
        return $this->hasMany(Health::class);
    }
}