Redirect to create page after submit
This commit is contained in:
@@ -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
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user