Changeset View
Changeset View
Standalone View
Standalone View
src/app/Entitlement.php
<?php | <?php | ||||
namespace App; | namespace App; | ||||
use Carbon\Carbon; | use Carbon\Carbon; | ||||
use Illuminate\Database\Eloquent\Model; | use Illuminate\Database\Eloquent\Model; | ||||
use Illuminate\Database\Eloquent\SoftDeletes; | use Illuminate\Database\Eloquent\SoftDeletes; | ||||
/** | /** | ||||
* The eloquent definition of an Entitlement. | * The eloquent definition of an Entitlement. | ||||
* | * | ||||
* Owned by a {@link \App\User}, billed to a {@link \App\Wallet}. | * Owned by a {@link \App\User}, billed to a {@link \App\Wallet}. | ||||
* | * | ||||
* @property int $cost | |||||
* @property ?string $description | |||||
* @property \App\Domain|\App\User $entitleable The entitled object (receiver of the entitlement). | |||||
* @property int $entitleable_id | |||||
* @property string $entitleable_type | |||||
* @property int $fee | |||||
* @property string $id | |||||
* @property \App\User $owner The owner of this entitlement (subject). | * @property \App\User $owner The owner of this entitlement (subject). | ||||
* @property \App\Sku $sku The SKU to which this entitlement applies. | * @property \App\Sku $sku The SKU to which this entitlement applies. | ||||
* @property string $sku_id | |||||
* @property \App\Wallet $wallet The wallet to which this entitlement is charged. | * @property \App\Wallet $wallet The wallet to which this entitlement is charged. | ||||
* @property \App\Domain|\App\User $entitleable The entitled object (receiver of the entitlement). | * @property string $wallet_id | ||||
*/ | */ | ||||
class Entitlement extends Model | class Entitlement extends Model | ||||
{ | { | ||||
use SoftDeletes; | use SoftDeletes; | ||||
/** | /** | ||||
* This table does not use auto-increment. | * This table does not use auto-increment. | ||||
* | * | ||||
Show All 14 Lines | class Entitlement extends Model | ||||
* @var array | * @var array | ||||
*/ | */ | ||||
protected $fillable = [ | protected $fillable = [ | ||||
'sku_id', | 'sku_id', | ||||
'wallet_id', | 'wallet_id', | ||||
'entitleable_id', | 'entitleable_id', | ||||
'entitleable_type', | 'entitleable_type', | ||||
'cost', | 'cost', | ||||
'description' | 'description', | ||||
'fee', | |||||
]; | ]; | ||||
protected $casts = [ | protected $casts = [ | ||||
'cost' => 'integer', | 'cost' => 'integer', | ||||
'fee' => 'integer' | |||||
]; | ]; | ||||
/** | /** | ||||
* Return the costs per day for this entitlement. | * Return the costs per day for this entitlement. | ||||
* | * | ||||
* @return float | * @return float | ||||
*/ | */ | ||||
public function costsPerDay() | public function costsPerDay() | ||||
▲ Show 20 Lines • Show All 91 Lines • Show Last 20 Lines |