Files
exchange-2.0/app/Models/UserAffiliate.php
T

48 lines
854 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class UserAffiliate extends AbstractModel
{
protected $table = 'user_affiliates';
protected $fillable = [
'user_id',
'affiliate_id',
'clicked_at',
'registered_at'
];
/**
* Get the attributes that should be cast.
*
* @return array<string, string>
*/
protected function casts(): array
{
return [
'clicked_at' => 'datetime',
'registered_at' => 'datetime',
];
}
/**
* @return BelongsTo
*/
public function user(): BelongsTo
{
return $this->belongsTo(User::class);
}
/**
* @return BelongsTo
*/
public function affiliate(): BelongsTo
{
return $this->belongsTo(Affiliate::class);
}
}