The inmovilla-api-proxy-bundle
is a Symfony bundle designed to act as a proxy for Inmovilla API requests, addressing IP-based access restrictions. It simplifies the setup and configuration for integrating the inmovilla-api-proxy
and inmovilla-api-client
libraries in Symfony applications.
- Seamless integration with
inmovilla-api-proxy
. - Handles IP-based access restrictions for Inmovilla API.
- Pre-configured Symfony services for easier implementation.
- Compatible with Symfony 5.4 and 6.x.
- PHP: 7.4 or higher.
- Symfony: 5.4 or higher.
- Composer: For dependency management.
Install the bundle using Composer:
composer require inigo-aldama/inmovilla-api-proxy-bundle
This bundle don't require extra configuration.
Follow instructions of inmovilla-api-client-bundle to configure the api client.
This configuration will automatically create a service for the proxy that can be injected into your Symfony controllers or services.
You can inject the proxy service directly into your controllers or services:
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);
}
}
Run PHPUnit tests to validate the functionality:
./vendor/bin/phpunit --testdox
- Fork the repository.
- Create a new branch (
git checkout -b feature/new-feature
). - Commit your changes (
git commit -m 'Add new feature'
). - Push to your branch (
git push origin feature/new-feature
). - Open a pull request.
This project is licensed under the MIT License.
- Author: Iñigo Aldama Gómez
- GitHub Repository: inmovilla-api-proxy-bundle