Files
besttechfrom.eu/app/Models/Upvote.php
T
2026-02-06 15:13:20 +02:00

43 lines
779 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class Upvote extends Model
{
/**
* Indicates if the model should be timestamped.
*
* @var bool
*/
public $timestamps = false;
/**
* The attributes that are mass assignable.
*
* @var array<int, string>
*/
protected $fillable = [
'user_id',
'product_id',
];
/**
* Get the user that owns the upvote.
*/
public function user(): BelongsTo
{
return $this->belongsTo(User::class);
}
/**
* Get the product that owns the upvote.
*/
public function product(): BelongsTo
{
return $this->belongsTo(Product::class);
}
}