Changeset View
Changeset View
Standalone View
Standalone View
src/app/Package.php
<?php | <?php | ||||
namespace App; | namespace App; | ||||
use Illuminate\Database\Eloquent\Model; | use Illuminate\Database\Eloquent\Model; | ||||
use Spatie\Translatable\HasTranslations; | |||||
/** | /** | ||||
* The eloquent definition of a Package. | * The eloquent definition of a Package. | ||||
* | * | ||||
* A package is a set of SKUs that a user can select, so that instead of; | * A package is a set of SKUs that a user can select, so that instead of; | ||||
* | * | ||||
* * Create a mailbox entitlement, | * * Create a mailbox entitlement, | ||||
* * Create a quota entitlement, | * * Create a quota entitlement, | ||||
* * Create a groupware entitlement, | * * Create a groupware entitlement, | ||||
* * ... | * * ... | ||||
* | * | ||||
* users can simply select a 'package'; | * users can simply select a 'package'; | ||||
* | * | ||||
* * Kolab package: mailbox + quota + groupware, | * * Kolab package: mailbox + quota + groupware, | ||||
* * Free package: mailbox + quota. | * * Free package: mailbox + quota. | ||||
* | * | ||||
* Selecting a package will therefore create a set of entitlments from SKUs. | * Selecting a package will therefore create a set of entitlments from SKUs. | ||||
*/ | */ | ||||
class Package extends Model | class Package extends Model | ||||
{ | { | ||||
use HasTranslations; | |||||
public $incrementing = false; | public $incrementing = false; | ||||
protected $keyType = 'string'; | protected $keyType = 'string'; | ||||
public $timestamps = false; | public $timestamps = false; | ||||
protected $fillable = [ | protected $fillable = [ | ||||
'description', | |||||
'discount_rate', | |||||
'name', | |||||
'title', | 'title', | ||||
]; | |||||
/** @var array Translatable properties */ | |||||
public $translatable = [ | |||||
'name', | |||||
'description', | 'description', | ||||
'discount_rate' | |||||
]; | ]; | ||||
/** | /** | ||||
* The costs of this package at its pre-defined, existing configuration. | * The costs of this package at its pre-defined, existing configuration. | ||||
* | * | ||||
* @return int The costs in cents. | * @return int The costs in cents. | ||||
*/ | */ | ||||
public function cost() | public function cost() | ||||
Show All 40 Lines |