messages implemented
This commit is contained in:
37
app/Models/ArtworkReaction.php
Normal file
37
app/Models/ArtworkReaction.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
/**
|
||||
* @property int $id
|
||||
* @property int $artwork_id
|
||||
* @property int $user_id
|
||||
* @property string $reaction ReactionType slug (e.g. thumbs_up, heart, fire…)
|
||||
*/
|
||||
class ArtworkReaction extends Model
|
||||
{
|
||||
public $timestamps = false;
|
||||
|
||||
protected $table = 'artwork_reactions';
|
||||
|
||||
protected $fillable = ['artwork_id', 'user_id', 'reaction'];
|
||||
|
||||
protected $casts = [
|
||||
'artwork_id' => 'integer',
|
||||
'user_id' => 'integer',
|
||||
'created_at' => 'datetime',
|
||||
];
|
||||
|
||||
public function artwork(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Artwork::class);
|
||||
}
|
||||
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user