Page MenuHomePhorge

Sku.php
No OneTemporary

Authored By
Unknown
Size
854 B
Referenced Files
None
Subscribers
None
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
/**
The eloquent definition of a Stock Keeping Unit (SKU).
*/
class Sku extends Model
{
public $incrementing = false;
protected $keyType = 'string';
protected $casts = [
'cost' => 'float',
];
protected $fillable = ['title', 'description', 'cost'];
/**
Provide a custom ID (uuid) property.
@return void
*/
protected static function boot()
{
parent::boot();
static::creating(
function ($sku) {
$sku->{$sku->getKeyName()} = \App\Utils::uuidStr();
}
);
}
/**
List the entitlements that consume this SKU.
@return Entitlement[]
*/
public function entitlements()
{
return $this->hasMany('App\Entitlement');
}
}

File Metadata

Mime Type
text/x-php
Expires
Fri, Apr 24, 12:46 PM (1 w, 5 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
18726558
Default Alt Text
Sku.php (854 B)

Event Timeline