Changeset View
Changeset View
Standalone View
Standalone View
src/app/Sku.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 Stock Keeping Unit (SKU). | * The eloquent definition of a Stock Keeping Unit (SKU). | ||||
*/ | */ | ||||
class Sku extends Model | class Sku extends Model | ||||
{ | { | ||||
use HasTranslations; | |||||
public $incrementing = false; | public $incrementing = false; | ||||
protected $keyType = 'string'; | protected $keyType = 'string'; | ||||
protected $casts = [ | protected $casts = [ | ||||
'units_free' => 'integer' | 'units_free' => 'integer' | ||||
]; | ]; | ||||
protected $fillable = [ | protected $fillable = [ | ||||
'title', | 'active', | ||||
'description', | |||||
'cost', | 'cost', | ||||
'units_free', | 'description', | ||||
'handler_class', | |||||
'name', | |||||
// persist for annual domain registration | // persist for annual domain registration | ||||
'period', | 'period', | ||||
'handler_class', | 'title', | ||||
'active' | 'units_free', | ||||
]; | |||||
/** @var array Translatable properties */ | |||||
public $translatable = [ | |||||
'name', | |||||
'description', | |||||
]; | ]; | ||||
/** | /** | ||||
* List the entitlements that consume this SKU. | * List the entitlements that consume this SKU. | ||||
* | * | ||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany | * @return \Illuminate\Database\Eloquent\Relations\HasMany | ||||
*/ | */ | ||||
public function entitlements() | public function entitlements() | ||||
Show All 12 Lines |