Adding Composer repository to the project
Before proceeding to the next steps, you should add the Mavryx repository to your project.
To do this, open the composer.json file and add the following information to the repositories section
{
"repositories": [{
"type": "composer",
"url": "https://satis.mavryx.software"
}]
}
Installing required components using Composer
Installation of Mavryx Symfony bundle
To install the bundle, run the following command in the main folder of your application.
composer require mavryx/mavryx-symfony-template:^1.0
Validate installation
php bin/console config:dump-reference
On the list you should see “MavryxBundle”
At this point, you should have access to the Mavryx\Bundle\Service\MavryxApiService from within Symfony.
<?php
namespace App\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Mavryx\Bundle\Service\MavryxApiService;
class SecurityController extends AbstractController
{
/**
* @Route("/someaction", name="someaction")
*/
public function someaction(Request $request,Response $response,MavryxApiService $mavryxApiService): Response
{
$api = $mavryxApiService->api();
/**
*
*/
return $response;
}
}