Feat: books published
This commit is contained in:
44
app/Models/BooksPublished.php
Normal file
44
app/Models/BooksPublished.php
Normal 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');
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user