Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F117884165
Referral.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
Referral.php
View Options
<?php
namespace
App
;
use
Carbon\Carbon
;
use
Illuminate\Database\Eloquent\Model
;
use
Illuminate\Database\Eloquent\Relations\BelongsTo
;
/**
* The eloquent definition of a Referral (code-to-referree relation).
*
* @property string $code Referral code
* @property int $id Record identifier
* @property ?Carbon $redeemed_at When the award got applied
* @property int $user_id User identifier
*/
class
Referral
extends
Model
{
/** @var list<string> The attributes that are mass assignable */
protected
$fillable
=
[
'user_id'
,
'code'
,
];
/** @var array<string, string> The attributes that should be cast */
protected
$casts
=
[
'created_at'
=>
'datetime:Y-m-d H:i:s'
,
'redeemed_at'
=>
'datetime:Y-m-d H:i:s'
,
];
/** @var bool Indicates if the model should be timestamped. */
public
$timestamps
=
false
;
/**
* The code this referral is assigned to
*
* @return BelongsTo<ReferralCode, $this>
*/
public
function
code
()
{
return
$this
->
belongsTo
(
ReferralCode
::
class
,
'code'
,
'code'
);
}
/**
* The user this referral is assigned to (referree)
*
* @return BelongsTo<User, $this>
*/
public
function
user
()
{
return
$this
->
belongsTo
(
User
::
class
,
'user_id'
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, Apr 6, 1:17 AM (1 d, 6 h)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
ad/04/459db0f95cb1c47de47bf0b4f292
Default Alt Text
Referral.php (1 KB)
Attached To
Mode
rK kolab
Attached
Detach File
Event Timeline