34 lines
665 B
PHP
34 lines
665 B
PHP
<?php
|
|
|
|
namespace Modules\IndustrialEngineering\Models;
|
|
|
|
use App\Contact;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
|
|
class Supplier extends Model
|
|
{
|
|
use BelongsToBusiness;
|
|
use SoftDeletes;
|
|
|
|
protected $table = 'ie_suppliers';
|
|
|
|
protected $guarded = ['id'];
|
|
|
|
protected $casts = [
|
|
'capabilities' => 'array',
|
|
'is_approved' => 'boolean',
|
|
'is_active' => 'boolean',
|
|
];
|
|
|
|
public function contact()
|
|
{
|
|
return $this->belongsTo(Contact::class);
|
|
}
|
|
|
|
public function partNumbers()
|
|
{
|
|
return $this->hasMany(SupplierPartNumber::class, 'supplier_id');
|
|
}
|
|
}
|