31 lines
663 B
PHP
31 lines
663 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Attributes\Guarded;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
#[Guarded(['id'])]
|
|
class CuttingResult extends Model
|
|
{
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'cutting_result' => 'integer',
|
|
'warehouse_stock' => 'integer',
|
|
'cutting_reject' => 'integer',
|
|
];
|
|
}
|
|
|
|
public function cutting(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Cutting::class);
|
|
}
|
|
|
|
public function productVariant(): BelongsTo
|
|
{
|
|
return $this->belongsTo(ProductVariant::class);
|
|
}
|
|
}
|