PHP code example of inigo-aldama / inmovilla-api-proxy-bundle

1. Go to this page and download the library: Download inigo-aldama/inmovilla-api-proxy-bundle library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

inigo-aldama / inmovilla-api-proxy-bundle example snippets


namespace App\Controller;

use Inmovilla\ApiProxyBundle\Service\ProxyService;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;

class ProxyController extends AbstractController
{
    private ProxyService $proxyService;

    public function __construct(ProxyService $proxyService)
    {
        $this->proxyService = $proxyService;
    }

    public function fetchProperties()
    {
        $response = $this->proxyService->handleRequest([
            'endpoint' => '/properties',
            'method' => 'GET',
            'parameters' => [],
        ]);

        return $this->json($response);
    }
}