1
0
forked from poc/pds

Redirect to create page after submit

This commit is contained in:
dhanabalan
2025-04-06 17:22:08 +05:30
parent 69ef321204
commit dc8e46283b
3 changed files with 18 additions and 0 deletions

View File

@@ -9,4 +9,9 @@ use Filament\Resources\Pages\CreateRecord;
class CreateProductionLineStop extends CreateRecord class CreateProductionLineStop extends CreateRecord
{ {
protected static string $resource = ProductionLineStopResource::class; protected static string $resource = ProductionLineStopResource::class;
protected function getRedirectUrl(): string
{
return $this->getResource()::getUrl('create'); // Stay on Create Page after saving
}
} }

View File

@@ -9,4 +9,9 @@ use Filament\Resources\Pages\CreateRecord;
class CreateProductionQuantity extends CreateRecord class CreateProductionQuantity extends CreateRecord
{ {
protected static string $resource = ProductionQuantityResource::class; protected static string $resource = ProductionQuantityResource::class;
protected function getRedirectUrl(): string
{
return $this->getResource()::getUrl('create'); // Stay on Create Page after saving
}
} }

View File

@@ -4,6 +4,7 @@ namespace App\Filament\Resources\QualityValidationResource\Pages;
use App\Filament\Resources\QualityValidationResource; use App\Filament\Resources\QualityValidationResource;
use Filament\Actions; use Filament\Actions;
use Filament\Forms\Components\Component;
use Filament\Resources\Pages\CreateRecord; use Filament\Resources\Pages\CreateRecord;
use Illuminate\Validation\ValidationException; use Illuminate\Validation\ValidationException;
@@ -11,6 +12,7 @@ class CreateQualityValidation extends CreateRecord
{ {
protected static string $resource = QualityValidationResource::class; protected static string $resource = QualityValidationResource::class;
protected function beforeCreate(): void protected function beforeCreate(): void
{ {
$errors = []; $errors = [];
@@ -91,4 +93,10 @@ class CreateQualityValidation extends CreateRecord
throw ValidationException::withMessages($errors); throw ValidationException::withMessages($errors);
} }
} }
protected function getRedirectUrl(): string
{
return $this->getResource()::getUrl('create'); // Stay on Create Page after saving
}
} }