- Deleted `data-table-actions.vue` component as it is no longer needed. - Removed `CuttingResultPriceItem` type and related properties from `cutting.ts`. - Updated routes in `web.php` to eliminate stock verification routes and permissions. - Removed `StockTest.php` file and its associated tests for stock verification and management. - Adjusted `CuttingTest.php` to reflect changes in cutting results handling and removed references to product variants.
39 lines
941 B
PHP
39 lines
941 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use App\Models\Concerns\InteractsWithActivityLog;
|
|
use Illuminate\Database\Eloquent\Attributes\Guarded;
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
|
|
#[Guarded(['id'])]
|
|
class CuttingResult extends Model
|
|
{
|
|
// 1. Use Trait
|
|
use HasFactory, InteractsWithActivityLog, SoftDeletes;
|
|
|
|
// 2. Casting
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'cutting_result' => 'integer',
|
|
'original_outside_sample' => 'integer',
|
|
'sample' => 'integer',
|
|
];
|
|
}
|
|
|
|
// 3. Relation
|
|
public function cutting(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Cutting::class)->withTrashed();
|
|
}
|
|
|
|
public function user(): BelongsTo
|
|
{
|
|
return $this->belongsTo(User::class)->withTrashed();
|
|
}
|
|
}
|