mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal.git
synced 2026-08-19 04:24:12 +00:00
31 lines
746 B
PHP
31 lines
746 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use App\Classes\General\Interfaces\Transportable;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
use Illuminate\Database\Eloquent\Relations\MorphMany;
|
|
|
|
class Container extends AbstractModel implements Transportable
|
|
{
|
|
use SoftDeletes;
|
|
|
|
protected $table = 'containers';
|
|
|
|
protected $fillable = ['status'];
|
|
|
|
public function packingLists(): belongsToMany
|
|
{
|
|
return $this->belongsToMany(PackingList::class, ContainerPackingList::class, 'container_id', 'packing_list_id');
|
|
}
|
|
|
|
/**
|
|
* @return MorphMany
|
|
*/
|
|
public function transports(): morphMany
|
|
{
|
|
return $this->morphMany(Transport::class, 'owner');
|
|
}
|
|
}
|