Added hiding logic of create button in panel box validation
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 13s
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 13s
This commit is contained in:
@@ -7,6 +7,7 @@ use App\Models\ProductCharacteristicsMaster;
|
||||
use Filament\Actions;
|
||||
use Filament\Resources\Pages\CreateRecord;
|
||||
use Illuminate\Validation\ValidationException;
|
||||
use Filament\Actions\Action;
|
||||
|
||||
class CreatePanelBoxValidation extends CreateRecord {
|
||||
|
||||
@@ -37,6 +38,17 @@ class CreatePanelBoxValidation extends CreateRecord {
|
||||
{
|
||||
$this->create();
|
||||
}
|
||||
public function getCreateFormAction(): Action
|
||||
{
|
||||
return parent::getCreateFormAction()
|
||||
->visible(fn () => $this->data['serial_exists'] != true);
|
||||
}
|
||||
|
||||
protected function getCreateAnotherFormAction(): Action
|
||||
{
|
||||
return parent::getCreateAnotherFormAction()
|
||||
->visible(fn () => ($this->data['serial_exists'] ?? false) != true);
|
||||
}
|
||||
|
||||
public function mount(): void
|
||||
{
|
||||
@@ -75,7 +87,7 @@ class CreatePanelBoxValidation extends CreateRecord {
|
||||
}
|
||||
}
|
||||
|
||||
protected function checkIfHasCharacteristics(array $data)
|
||||
public function checkIfHasCharacteristics(array $data)
|
||||
{
|
||||
$plantId = $data['plant_id'] ?? null;
|
||||
$itemCode = $data['item_id'] ?? null;
|
||||
|
||||
Reference in New Issue
Block a user