File: D:/HostingSpaces/stafa/werkenbijstafa.nl/app/Komma/Shop/Shipments/Shipment.php
<?php
namespace App\Komma\Shop\Shipments;
use App\Komma\Kms\Core\Attributes\Models\Traits\HasThumbnailInterface;
use App\Komma\Kms\Core\Attributes\Models\Traits\HasThumbnailTrait;
use App\Komma\Kms\Core\Entities\DisplayNameTrait;
use App\Komma\Shop\Orders\Models\Order;
use App\Komma\Shop\Orders\Product\OrderedProduct;
use App\Komma\Shop\Orders\ProductComposite\OrderedProductComposite;
use App\Komma\Shop\Orders\ProductGroup\OrderedProductGroup;
use App\Komma\Shop\ShipmentGroups\ShipmentGroup;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasManyThrough;
/**
* Class Shipment
*
* @property string comment
* @package App\Komma\Shop\Shipment
* @property int $id
* @property int $order_id
* @property int|null $shipment_group_id
* @property string $status
* @property string $tracking_code
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property-read \App\Komma\Shop\Orders\Models\Order $order
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Komma\Shop\Orders\ProductComposite\OrderedProductComposite[] $orderedProductComposites
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Komma\Shop\Orders\ProductGroup\OrderedProductGroup[] $orderedProductGroups
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Komma\Shop\Orders\Product\OrderedProduct[] $orderedProducts
* @property-read \App\Komma\Shop\Shipments\ShipmentGroup|null $shipmentGroup
* @method static \Illuminate\Database\Eloquent\Builder|\App\Komma\Shop\Shipments\Shipment newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Komma\Shop\Shipments\Shipment newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Komma\Shop\Shipments\Shipment query()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Komma\Shop\Shipments\Shipment whereComment($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Komma\Shop\Shipments\Shipment whereCreatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Komma\Shop\Shipments\Shipment whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Komma\Shop\Shipments\Shipment whereOrderId($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Komma\Shop\Shipments\Shipment whereShipmentGroupId($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Komma\Shop\Shipments\Shipment whereStatus($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Komma\Shop\Shipments\Shipment whereTrackingCode($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Komma\Shop\Shipments\Shipment whereUpdatedAt($value)
* @mixin \Eloquent
*/
class Shipment extends Model implements HasThumbnailInterface
{
protected $name = '';
use DisplayNameTrait;
use HasThumbnailTrait;
public function __construct(array $attributes = [])
{
$this->name = __('shop/shipments.shipment');
parent::__construct($attributes);
}
public function order(): BelongsTo
{
return $this->belongsTo(Order::class);
}
public function orderedProducts(): HasManyThrough
{
return $this->hasManyThrough(OrderedProduct::class, Order::class);
}
public function orderedProductGroups(): HasManyThrough
{
return $this->hasManyThrough(OrderedProductGroup::class, Order::class);
}
public function orderedProductComposites(): HasManyThrough
{
return $this->hasManyThrough(OrderedProductComposite::class, Order::class);
}
public function shipmentGroup(): BelongsTo
{
return $this->belongsTo(ShipmentGroup::class);
}
}