Feat: Publication

This commit is contained in:
Sallu9007
2025-03-31 20:25:18 +05:30
parent 5942e55916
commit b2060c47e2
11 changed files with 1026 additions and 1 deletions

View File

@@ -0,0 +1,69 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Publication extends Model
{
use HasFactory;
protected $fillable = [
'department_id',
'first_author_name',
'co_authors',
'start_date',
'end_date',
'num_days',
'activity_type',
'title',
'affiliation',
'organizing_institute',
'venue_address',
'is_peer_reviewed',
'scopus_link',
'sci_link',
'paper_file',
'faculty_id'
];
protected $casts = [
'start_date' => 'datetime',
'end_date' => 'datetime',
'num_days' => 'integer',
'is_peer_reviewed' => 'string'
];
/**
* Get the department that owns the publication.
*/
public function department()
{
return $this->belongsTo(Department::class);
}
/**
* Get the faculty user that owns the publication.
*/
public function user()
{
return $this->belongsTo(User::class, 'faculty_id');
}
/**
* Check if the publication is Scopus indexed.
*/
public function isScopusIndexed()
{
return !is_null($this->scopus_link);
}
/**
* Check if the publication is SCI indexed.
*/
public function isSciIndexed()
{
return !is_null($this->sci_link);
}
}