35 lines
627 B
PHP
35 lines
627 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class PromoUsage extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $fillable = [
|
|
'promo_id',
|
|
'user_id',
|
|
'used_at',
|
|
'ip',
|
|
'user_agent',
|
|
];
|
|
|
|
protected $casts = [
|
|
'used_at' => 'datetime',
|
|
];
|
|
|
|
public function promo(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Promo::class);
|
|
}
|
|
|
|
public function user(): BelongsTo
|
|
{
|
|
return $this->belongsTo(User::class);
|
|
}
|
|
}
|