generated from Flycro/laravel-nuxt
feat: Multiple Systems
This commit is contained in:
34
app/Models/BookRecommendation.php
Normal file
34
app/Models/BookRecommendation.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class BookRecommendation extends Model
|
||||
{
|
||||
protected $table = 'book_recommendations';
|
||||
|
||||
protected $fillable = [
|
||||
'book_name',
|
||||
'author',
|
||||
'description',
|
||||
'isbn',
|
||||
'pages',
|
||||
'recommended_by',
|
||||
'cover_image',
|
||||
'status',
|
||||
];
|
||||
|
||||
/**
|
||||
* Get the user that recommended the book.
|
||||
*/
|
||||
public function recommender()
|
||||
{
|
||||
return $this->belongsTo(User::class, 'recommended_by');
|
||||
}
|
||||
|
||||
public function votes()
|
||||
{
|
||||
return $this->hasMany(Vote::class);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user