lasselehtinen / mockingbird-api-client
This is a cliexternal API
Package info
github.com/lasselehtinen/mockingbird-api-client
pkg:composer/lasselehtinen/mockingbird-api-client
Fund package maintenance!
Requires
- php: ^8.4
- illuminate/contracts: ^11.0||^12.0||^13.0
- spatie/laravel-data: ^4.23
- spatie/laravel-package-tools: ^1.16
Requires (Dev)
- larastan/larastan: ^3.0
- laravel/pint: ^1.14
- nunomaduro/collision: ^8.8
- orchestra/testbench: ^11.0.0||^10.0.0||^9.0.0
- pestphp/pest: ^4.0
- pestphp/pest-plugin-arch: ^4.0
- pestphp/pest-plugin-laravel: ^4.0
- phpstan/extension-installer: ^1.4
- phpstan/phpstan-deprecation-rules: ^2.0
- phpstan/phpstan-phpunit: ^2.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Mockingbird External API Client
A Laravel API client for Mockingbird that provides OAuth authentication, strongly typed DTOs powered by Spatie Laravel Data, and convenient service classes for accessing editions, contributors, assets and other Mockingbird resources.
Installation
You can install the package via composer:
composer require lasselehtinen/mockingbird-api-client
You can publish the config file with:
php artisan vendor:publish --tag="mockingbird-api-client-config"
This is the contents of the published config file:
return [ 'base_url' => env('MOCKINGBIRD_BASE_URL', 'https://tenantname-external-api-app.azurewebsites.net'), 'oauth_url' => env('MOCKINGBIRD_OAUTH_URL', 'https://tenantname-identity-app.azurewebsites.net/core/connect/token'), 'client_id' => env('MOCKINGBIRD_CLIENT_ID', 'client_name_here'), 'client_secret' => env('MOCKINGBIRD_CLIENT_SECRET', 'client_secret_here'), 'username' => env('MOCKINGBIRD_USERNAME', 'firstname.lastname@tenant.com'), 'password' => env('MOCKINGBIRD_PASSWORD', 'mockingbird_user_password_here'), 'scope' => env('MOCKINGBIRD_SCOPE', 'opus'), ];
Usage
The package exposes dedicated services for each API area.
Edition
use Lasselehtinen\MockingbirdApiClient\Editions\EditionService; $edition = app(EditionService::class); $edition = $edition->get('1ca73850-96c2-4ac3-8b98-44d35c9378d1');
Or through dependency injection:
use Lasselehtinen\MockingbirdApiClient\Editions\EditionService; final class EditionController { public function __construct( private readonly EditionService $edition, ) {} public function show(string $id) { return $this->edition->get($id); } }
The service is registered as a singleton and can be resolved from Laravel's service container.
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.