mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal.git
synced 2026-08-19 04:24:12 +00:00
39 lines
799 B
PHP
39 lines
799 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
|
|
/**
|
|
* Class Segment
|
|
* @package App\Models
|
|
*
|
|
* @property string name
|
|
* @property string reference
|
|
*/
|
|
class Segment extends AbstractModel
|
|
{
|
|
use SoftDeletes;
|
|
|
|
protected $table = 'segments';
|
|
|
|
protected $dates = ['deleted_at'];
|
|
|
|
/**
|
|
* @return HasMany
|
|
*/
|
|
public function constants(): HasMany
|
|
{
|
|
return $this->HasMany(SegmentConstant::class, 'segment_id', 'id');
|
|
}
|
|
|
|
/**
|
|
* @return belongsToMany
|
|
*/
|
|
public function companyConnections(): belongsToMany
|
|
{
|
|
return $this->belongsToMany(CompanyConnection::class, (new ConnectionSegment())->getTable(), 'segment_id', 'company_connection_id');
|
|
}
|
|
}
|