src/Controller/IndexController.php line 12

Open in your IDE?
  1. <?php
  2. // src/Controller/IndexController.php
  3. namespace App\Controller;
  4. use Kreait\Firebase\Factory;
  5. use Symfony\Component\HttpFoundation\Response;
  6. use Symfony\Component\Routing\Annotation\Route;
  7. class IndexController
  8. {
  9.     #[Route('/'name'homepage')]
  10.     public function index(): Response
  11.     {
  12.         return new Response(
  13.             '<html><body>RandaleAPP</body></html>'
  14.         );
  15.     }
  16.     #[Route('/test-firebase'name'test_firebase'methods: ['GET'])]
  17.     public function testFirebase(): Response
  18.     {
  19.         $serviceAccountPath '/Users/filipcekic/all-projects/randale-new/randale/config/firebase_service_account.json';
  20.         $factory = (new Factory)->withServiceAccount($serviceAccountPath);
  21.         $firebase $factory->createAuth();
  22.     
  23.         ob_start();
  24.         var_dump($firebase);
  25.         $output ob_get_clean();
  26.     
  27.         return new Response('Firebase test completed, check dump output: ' $output);
  28.     }
  29.     
  30. }