Custom button for a form

Hi, I created a custom button to create records in another way, the problem is that people who are not logged in can enter this path, how can I hide this path for people who are not logged in?

public static function getPages(): array
    {
        return [
            'index' => Pages\ListAcademicComponents::route('/'),
            'createform' => Pages\FormAcademicComponent::route('/form'),
            //'create' => Pages\CreateAcademicComponent::route('/create'),
            //'edit' => Pages\EditAcademicComponent::route('/{record}/edit'),
        ];
    }
image.png
Solution
But the route you showed is /form-academic-component not /dashboard/academic-components ?!
Was this page helpful?