CreateStudent.php 768 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. namespace App\Filament\Resources\StudentResource\Pages;
  3. use App\Filament\Resources\StudentResource;
  4. use Filament\Resources\Pages\CreateRecord;
  5. class CreateStudent extends CreateRecord
  6. {
  7. protected static string $resource = StudentResource::class;
  8. protected function getRedirectUrl(): string
  9. {
  10. return $this->getResource()::getUrl('index');
  11. }
  12. protected function getCreatedNotificationTitle(): ?string
  13. {
  14. return '学生创建成功';
  15. }
  16. protected function getCreatedNotification(): ?\Filament\Notifications\Notification
  17. {
  18. return \Filament\Notifications\Notification::make()
  19. ->success()
  20. ->title('学生创建成功')
  21. ->body('学生信息已成功保存。');
  22. }
  23. }