<?php

namespace App\Models;

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

class Patent extends Model
{
    use HasFactory;

    protected $fillable = [
        'department_id',
        'faculty_id',
        'title',
        'investigator',
        'application_no',
        'type',
        'date_of_submission',
        'date_of_filling',
        'status',
        'proof'
    ];


    // Relationship with User (Faculty)
    public function user()
    {
        return $this->belongsTo(User::class, 'faculty_id');
    }

    // Relationship with Department
    public function department()
    {
        return $this->belongsTo(Department::class, 'department_id');
    }
}