PingController.php 339 B

12345678910111213141516
  1. <?php
  2. namespace Test\Michel\Controller;
  3. use Michel\Attribute\Route;
  4. use Michel\Attribute\ControllerRoute;
  5. #[ControllerRoute('/api', format: 'json')]
  6. class PingController
  7. {
  8. #[Route('ping', name: 'ping', methods: ['GET'])]
  9. public function ping(): string
  10. {
  11. return json_encode(['pong' => true]);
  12. }
  13. }