Feat: books published

This commit is contained in:
Sallu9007
2025-03-31 22:57:21 +05:30
parent b2060c47e2
commit 2aa0cf0449
11 changed files with 853 additions and 61 deletions

View File

@@ -0,0 +1,44 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class BooksPublished extends Model
{
use HasFactory;
protected $table = 'books_published';
protected $fillable = [
'department_id',
'faculty_id',
'author',
'title',
'publisher',
'issn',
'date_of_publication',
'proof',
];
protected $casts = [
'date_of_publication' => 'date',
];
/**
* 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');
}
}