50 lines
1 KiB
PHP
50 lines
1 KiB
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class ProductLogistics extends Model
|
|
{
|
|
public $timestamps = false;
|
|
|
|
protected $fillable = [
|
|
'product_variant_id',
|
|
'shipping_class_id',
|
|
'package_width_cm',
|
|
'package_height_cm',
|
|
'package_depth_cm',
|
|
'package_weight_g',
|
|
'package_count',
|
|
'location_bin',
|
|
'packaging_type',
|
|
'packaging_recyclable_percent',
|
|
'is_palletizable',
|
|
'hs_code',
|
|
];
|
|
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'package_count' => 'integer',
|
|
'is_palletizable' => 'boolean',
|
|
];
|
|
}
|
|
|
|
/**
|
|
* Gehört zu einer Produkt-Variante.
|
|
*/
|
|
public function productVariant(): BelongsTo
|
|
{
|
|
return $this->belongsTo(ProductVariant::class);
|
|
}
|
|
|
|
/**
|
|
* Versandklasse.
|
|
*/
|
|
public function shippingClass(): BelongsTo
|
|
{
|
|
return $this->belongsTo(ShippingClass::class);
|
|
}
|
|
}
|