chore: initial commit of existing codebase
This commit is contained in:
commit
11e94889b2
292 files changed
+38586
No files matched your search
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class BillOfMaterial extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'bill_of_materials';
|
||||
|
||||
protected $fillable = ['product_id', 'raw_material_id', 'quantity_required', 'unit_of_measure', 'notes'];
|
||||
|
||||
protected $casts = ['quantity_required' => 'decimal:2'];
|
||||
|
||||
public function product()
|
||||
{
|
||||
return $this->belongsTo(Item::class, 'product_id');
|
||||
}
|
||||
|
||||
public function rawMaterial()
|
||||
{
|
||||
return $this->belongsTo(Item::class, 'raw_material_id');
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user