EditTeacher.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. namespace App\Filament\Resources\TeacherResource\Pages;
  3. use App\Filament\Resources\TeacherResource;
  4. use Filament\Resources\Pages\EditRecord;
  5. class EditTeacher extends EditRecord
  6. {
  7. protected static string $resource = TeacherResource::class;
  8. protected function getRedirectUrl(): string
  9. {
  10. return $this->getResource()::getUrl('index');
  11. }
  12. protected function getSavedNotificationTitle(): ?string
  13. {
  14. return '教师信息已更新';
  15. }
  16. protected function getSavedNotification(): ?\Filament\Notifications\Notification
  17. {
  18. return \Filament\Notifications\Notification::make()
  19. ->success()
  20. ->title('教师信息已更新')
  21. ->body('教师信息已成功更新。');
  22. }
  23. public function getTitle(): string
  24. {
  25. return '编辑教师';
  26. }
  27. public function getBreadcrumbs(): array
  28. {
  29. return [
  30. '#' => '师生管理',
  31. static::getResource()::getUrl('index') => '教师管理',
  32. static::getResource()::getUrl('edit', ['record' => $this->record]) => '编辑教师',
  33. ];
  34. }
  35. }