mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/portal.git
synced 2026-08-21 05:24:09 +00:00
28 lines
621 B
PHP
28 lines
621 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
use Illuminate\Database\Eloquent\Relations\MorphMany;
|
|
|
|
class Container extends AbstractModel
|
|
{
|
|
use SoftDeletes;
|
|
|
|
protected $table = 'containers';
|
|
|
|
public function packingLists(): belongsToMany
|
|
{
|
|
return $this->belongsToMany(PackingList::class, Container::class, 'container_id', 'packing_list_id');
|
|
}
|
|
|
|
/**
|
|
* @return MorphMany
|
|
*/
|
|
public function transports(): morphMany
|
|
{
|
|
return $this->morphMany(Transport::class, 'owner');
|
|
}
|
|
}
|