mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-19 12:33:56 +00:00
48 lines
854 B
PHP
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);
|
|
}
|
|
}
|
|
|