mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal.git
synced 2026-08-19 04:24:12 +00:00
35 lines
792 B
PHP
35 lines
792 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
|
use Illuminate\Database\Eloquent\Relations\MorphMany;
|
|
|
|
class Order extends AbstractModel
|
|
{
|
|
use SoftDeletes;
|
|
|
|
protected $table = 'orders';
|
|
|
|
protected $dates = ['deleted_at'];
|
|
|
|
|
|
public function companyModule(): belongsTo
|
|
{
|
|
return $this->belongsTo(CompanyModule::class, 'company_module_id', 'id');
|
|
}
|
|
|
|
public function orderSteps()
|
|
{
|
|
return $this->hasMany(OrderStep::class, 'order_id');
|
|
}
|
|
|
|
public function addresses(): morphMany
|
|
{
|
|
return $this->morphMany(Address::class, 'owner');
|
|
}
|
|
}
|