mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/portal.git
synced 2026-08-29 01:14:14 +00:00
update packinglists from vt portal
This commit is contained in:
@@ -2,17 +2,58 @@
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Classes\General\Interfaces\Steppable;
|
||||
use App\Classes\General\Interfaces\Transportable;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\Relations\MorphMany;
|
||||
use Illuminate\Database\Eloquent\Relations\MorphTo;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
class PackingList extends AbstractModel
|
||||
class PackingList extends AbstractModel implements Transportable, Steppable
|
||||
{
|
||||
use SoftDeletes;
|
||||
|
||||
protected $table = 'packing_lists';
|
||||
|
||||
public function orderSteps(): morphMany
|
||||
protected $fillable = ['status'];
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\MorphTo
|
||||
*/
|
||||
public function owner(): morphTo
|
||||
{
|
||||
return $this->morphTo();
|
||||
}
|
||||
|
||||
public function containers(): BelongsToMany
|
||||
{
|
||||
return $this->BelongsToMany(Container::class, ContainerPackingList::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return MorphMany
|
||||
*/
|
||||
public function steps(): morphMany
|
||||
{
|
||||
return $this->morphMany(Step::class, 'owner');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return HasMany
|
||||
*/
|
||||
public function packages(): hasMany
|
||||
{
|
||||
return $this->hasMany(Package::class, 'packing_list_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return morphMany
|
||||
*/
|
||||
public function transports(): morphMany
|
||||
{
|
||||
return $this->morphMany(Transport::class, 'owner');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user