Skip to content

#[Route] attribute on method cannot be found if preceded by another attribute #2381

@alcohol

Description

@alcohol

May or may not be related to #2176 ?

This does not work:

#[IsGranted('ROLE_ADMIN')]
#[Route(path: '/admin', name: 'admin', methods: ['GET', 'POST'])]
public function admin(Request $request): Response

This works:

#[Route(path: '/admin', name: 'admin', methods: ['GET', 'POST'])]
#[IsGranted('ROLE_ADMIN')]
public function admin(Request $request): Response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions