Current state
This commit is contained in:
33
app/Models/ArtworkStats.php
Normal file
33
app/Models/ArtworkStats.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
/**
|
||||
* App\Models\ArtworkStats
|
||||
*
|
||||
* @property-read Artwork $artwork
|
||||
*/
|
||||
class ArtworkStats extends Model
|
||||
{
|
||||
protected $table = 'artwork_stats';
|
||||
|
||||
protected $primaryKey = 'artwork_id';
|
||||
|
||||
public $incrementing = false;
|
||||
|
||||
protected $fillable = [
|
||||
'artwork_id',
|
||||
'views',
|
||||
'downloads',
|
||||
'favorites',
|
||||
'rating_avg',
|
||||
'rating_count',
|
||||
];
|
||||
|
||||
public function artwork(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Artwork::class, 'artwork_id');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user