28 lines
481 B
PHP
28 lines
481 B
PHP
<?php
|
|
|
|
namespace Modules\Tms\Models;
|
|
|
|
use App\Contact;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Carrier extends Model
|
|
{
|
|
protected $table = 'tms_carriers';
|
|
|
|
protected $guarded = ['id'];
|
|
|
|
protected $casts = [
|
|
'is_active' => 'boolean',
|
|
];
|
|
|
|
public function contact()
|
|
{
|
|
return $this->belongsTo(Contact::class, 'contact_id');
|
|
}
|
|
|
|
public function shipments()
|
|
{
|
|
return $this->hasMany(Shipment::class, 'carrier_id');
|
|
}
|
|
}
|