Search by

lasselehtinen / mockingbird-api-client

lasleh

This is a cliexternal API

Package info

github.com/lasselehtinen/mockingbird-api-client

pkg:composer/lasselehtinen/mockingbird-api-client

Fund package maintenance!

lasselehtinen

Statistics

Installs: 15

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v0.1 2026-09-25 12:47 UTC

This package is auto-updated.

Last update: 2026-09-25 12:50:15 UTC


README

Latest Version on Packagist run-tests Total Downloads

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.