'product_key', 'notes|description|details' => 'notes', 'cost|amount|price' => 'cost', ]; } /** * @return mixed */ public function getEntityType() { return ENTITY_PRODUCT; } /** * @param $key * @return mixed */ public static function findProductByKey($key) { return Product::scope()->where('product_key', '=', $key)->first(); } /** * @return mixed */ public function user() { return $this->belongsTo('App\Models\User')->withTrashed(); } /** * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ public function default_tax_rate() { return $this->belongsTo('App\Models\TaxRate'); } public static function getStatuses($entityType = false) { $statuses = parent::getStatuses($entityType); unset($statuses[STATUS_DELETED]); return $statuses; } }