EditStudent.php 938 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. namespace App\Filament\Resources\StudentResource\Pages;
  3. use App\Filament\Resources\StudentResource;
  4. use Filament\Actions;
  5. use Filament\Resources\Pages\EditRecord;
  6. class EditStudent extends EditRecord
  7. {
  8. protected static string $resource = StudentResource::class;
  9. protected string $view = 'filament.resources.student-resource.pages.edit-student';
  10. public function getTitle(): string
  11. {
  12. return '编辑学生';
  13. }
  14. protected function getHeaderActions(): array
  15. {
  16. return [];
  17. }
  18. protected function getRedirectUrl(): string
  19. {
  20. return $this->getResource()::getUrl('view', ['record' => $this->record]);
  21. }
  22. protected function getSavedNotification(): ?\Filament\Notifications\Notification
  23. {
  24. return \Filament\Notifications\Notification::make()
  25. ->success()
  26. ->title('保存成功')
  27. ->body('学生信息已更新。');
  28. }
  29. }