<?php
// src/Controller/IndexController.php
namespace App\Controller;
use Kreait\Firebase\Factory;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
class IndexController
{
#[Route('/', name: 'homepage')]
public function index(): Response
{
return new Response(
'<html><body>RandaleAPP</body></html>'
);
}
#[Route('/test-firebase', name: 'test_firebase', methods: ['GET'])]
public function testFirebase(): Response
{
$serviceAccountPath = '/Users/filipcekic/all-projects/randale-new/randale/config/firebase_service_account.json';
$factory = (new Factory)->withServiceAccount($serviceAccountPath);
$firebase = $factory->createAuth();
ob_start();
var_dump($firebase);
$output = ob_get_clean();
return new Response('Firebase test completed, check dump output: ' . $output);
}
}