Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F7058034
Tenant.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
Tenant.php
View Options
<?php
namespace
App
;
use
Illuminate\Database\Eloquent\Model
;
/**
* The eloquent definition of a Tenant.
*
* @property int $id
* @property string $title
*/
class
Tenant
extends
Model
{
protected
$fillable
=
[
'id'
,
'title'
,
];
protected
$keyType
=
'bigint'
;
/**
* Discounts assigned to this tenant.
*
* @return \Illuminate\Database\Eloquent\Relations\HasMany
*/
public
function
discounts
()
{
return
$this
->
hasMany
(
'App
\D
iscount'
);
}
/**
* SignupInvitations assigned to this tenant.
*
* @return \Illuminate\Database\Eloquent\Relations\HasMany
*/
public
function
signupInvitations
()
{
return
$this
->
hasMany
(
'App
\S
ignupInvitation'
);
}
/*
* Returns the wallet of the tanant (reseller's wallet).
*
* @return ?\App\Wallet A wallet object
*/
public
function
wallet
():
?
Wallet
{
$user
=
\App\User
::
where
(
'role'
,
'reseller'
)->
where
(
'tenant_id'
,
$this
->
id
)->
first
();
return
$user
?
$user
->
wallets
->
first
()
:
null
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Fri, Jun 12, 4:19 AM (10 h, 49 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
914802
Default Alt Text
Tenant.php (1 KB)
Attached To
Mode
R2 kolab
Attached
Detach File
Event Timeline
Log In to Comment