36 lines
669 B
PHP
36 lines
669 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Spool extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $table = 'pdfm_spools';
|
|
|
|
protected $fillable = [
|
|
'spool_no',
|
|
'description',
|
|
'material',
|
|
'diameter',
|
|
'thickness',
|
|
'length',
|
|
'classification',
|
|
'status'
|
|
];
|
|
|
|
// Relationships
|
|
public function joints()
|
|
{
|
|
return $this->hasMany(Joint::class, 'spool_no', 'spool_no');
|
|
}
|
|
|
|
public function annotations()
|
|
{
|
|
return $this->hasMany(Annotation::class, 'spool_no', 'spool_no');
|
|
}
|
|
}
|