<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class ActivitiesAttended extends Model
{
    use HasFactory;

    protected $fillable = [
        'title',
        'organising_institute',
        'address',
        'department_id',
        'faculty_id',
        'start_date',
        'end_date',
        'num_days',
        'activity_type',
        'category',
        'level',        
        'proof',
    ];

    protected $casts = [
        'start_date' => 'datetime',
        'end_date' => 'datetime',
    ];


    // Define the relationship to the User (Faculty)
    public function department()
    {
        return $this->belongsTo(Department::class, 'department_id');
    }
    public function user()
    {
        return $this->belongsTo(User::class, 'faculty_id');
    }
}
