yoerioptr / tabt-api-bundle
Symfony inteagration for the TabT API client
Package info
github.com/yoerioptr/TabtApiBundle
Type:symfony-bundle
pkg:composer/yoerioptr/tabt-api-bundle
Requires
- php: ^8.1
- symfony/config: ^6.4 || ^7.0 || ^8.0
- symfony/dependency-injection: ^8.1
- symfony/http-kernel: ^6.4 || ^7.0 || ^8.0
- yoerioptr/tabt-api-client: ^2.1
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.95
- phpunit/phpunit: ^10.5 || ^11.0 || ^12.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
The TabT API Bundle is a Symfony integration for the TabT API Client, a helper library for Frenoy's TabT API.
Setup
Basic setup to get you started using the bundle.
First of all, install the package using Composer
composer require yoerioptr/tabt-api-bundle
Register the bundle if Symfony Flex did not register it automatically.
// config/bundles.php return [ // ... Yoerioptr\TabtApiBundle\TabtApiBundle::class => ['all' => true], ];
Optionally configure your TabT credentials.
# config/packages/tabt_api.yaml tabt_api: username: '%env(TABT_USERNAME)%' password: '%env(TABT_PASSWORD)%'
Add the credentials to your environment.
TABT_USERNAME=username TABT_PASSWORD=password
Credentials are optional and only required for API requests that require authentication.
Making Requests
The TabT API Client is automatically registered as a Symfony service and can be injected using TabtInterface.
use Yoerioptr\TabtApiClient\TabtInterface; final class ExampleService { public function __construct( private readonly TabtInterface $tabt, ) { } public function example(): void { $testResponse = $this->tabt->test()->info(); } }
Executing requests makes use of repositories, which can easily be accessed from the TabT helper class.
$testResponse = $this->tabt->test()->info();
All usable requests can be found in the TabT API Client.
Configuration
The following configuration options are available.
tabt_api: username: null password: null
Both username and password are optional.
Requirements
- PHP
- Symfony
yoerioptr/tabt-api-client
License
This package is released under the MIT License.