Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 10s
Gemini PR Review / review (pull_request) Failing after 1m21s
Laravel Larastan / larastan (pull_request) Failing after 3m8s
Laravel Pint / pint (pull_request) Successful in 2m32s
50 lines
1.4 KiB
PHP
50 lines
1.4 KiB
PHP
<?php
|
|
|
|
namespace App\Filament\Resources\ProductCharacteristicsMasterResource\Pages;
|
|
|
|
use App\Filament\Resources\ProductCharacteristicsMasterResource;
|
|
use Filament\Actions;
|
|
use Filament\Resources\Pages\EditRecord;
|
|
|
|
class EditProductCharacteristicsMaster extends EditRecord
|
|
{
|
|
protected static string $resource = ProductCharacteristicsMasterResource::class;
|
|
|
|
public function getTitle(): string
|
|
{
|
|
return 'Edit Characteristics'; // This will replace the "New product characteristics master"
|
|
}
|
|
|
|
public function mount(int|string $record): void
|
|
{
|
|
parent::mount($record);
|
|
|
|
$model = $this->getRecord(); // actual model instance
|
|
|
|
// Step 1: Fill the actual saved fields first
|
|
$this->form->fill([
|
|
'plant_id' => $model->plant_id,
|
|
'line_id' => $model->line_id,
|
|
'item_id' => $model->item_id,
|
|
'machine_id' => $model->machine_id,
|
|
'name' => $model->name,
|
|
'type' => $model->type,
|
|
'upper' => $model->upper,
|
|
'lower' => $model->lower,
|
|
'middle' => $model->middle,
|
|
'work_group_master_id' => optional($model->machine)->work_group_master_id,
|
|
]);
|
|
|
|
}
|
|
|
|
protected function getHeaderActions(): array
|
|
{
|
|
return [
|
|
Actions\ViewAction::make(),
|
|
Actions\DeleteAction::make(),
|
|
Actions\ForceDeleteAction::make(),
|
|
Actions\RestoreAction::make(),
|
|
];
|
|
}
|
|
}
|