EditStudent.php 980 B

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