liberusoftware/profiles-api
A Laravel package that provides a RESTful API layer for managing user profiles, offering endpoints for creating, reading, updating, and deleting profile data so applications can expose profile functionality to clients and frontends without building the API from scratch.
Because this package is a presentation adapter, treat it as the HTTP skin over a profiles domain module — it almost certainly does not contain the entities, repositories, or migrations itself. Your first job is confirming what it depends on.
Install and inspect the dependency graph before writing code.
composer require liberusoftware/profiles-api
composer show liberusoftware/profiles-api
Read require in the installed composer.json. You will likely see a sibling package such as liberusoftware/module-profiles (or an equivalent domain/application package). If that is not installed, the adapter will boot but fail at container resolution time. Install the domain package first.
Find the service provider. Look in vendor/liberusoftware/profiles-api/src/Providers/. Laravel auto-discovery should register it, but confirm with:
php artisan about
php artisan route:list --path=api
The route list is the fastest way to learn the surface area of the adapter — it tells you the URI prefixes, controller classes, middleware, and route names in one shot.
Read these files in order:
routes/api.php (or routes/*.php) — the actual API contract.src/Http/Controllers/ — how thin the controllers are and what they delegate to.src/Http/Resources/ or src/Http/Responses/ — output shape and field names.config/profiles-api.php (if present) — route prefix, middleware, pagination defaults.src/Providers/*ServiceProvider.php — what interfaces are bound and what is publishable.Publish anything publishable.
php artisan vendor:publish --provider="LiberuSoftware\ProfilesApi\ProfilesApiServiceProvider"
Check --tag options; adapters commonly publish config and sometimes route files so you can override middleware.
First use case: authenticate a request and call the profile read endpoint end-to-end. Use php artisan tinker or a seeded user, hit GET /api/profiles/{id} (verify exact path from route:list), and confirm the JSON envelope. That single request validates routes, middleware, the domain binding, and the resource transformer all at once. Do this before building anything on top.
Keep controllers thin; put behavior in the domain layer. The adapter's controllers should be pure transport. If you need new business rules (e.g., "profiles can only be archived by their owner"), implement them in the domain/application package and let the adapter call them. Adding logic to the adapter controllers creates a second source of truth that will drift.
Override resources rather than editing vendor files. For response shape changes (adding a field, renaming a key, embedding a relation), extend the package's JsonResource class in your app and rebind or re-register the route. Typical approach:
// app/Http/Resources/ProfileResource.php
class ProfileResource extends \LiberuSoftware\ProfilesApi\Http\Resources\ProfileResource
{
public function toArray($request): array
{
return array_merge(parent::toArray($request), [
'avatar_url' => $this->avatarUrl(),
]);
}
}
Then either bind it in a service provider if the package resolves resources from the container, or take over the route entirely.
Take over routes consciously. If the package's routes are registered from its provider, you have three options: (a) disable them via config and re-declare your own in routes/api.php, (b) register your routes after the package's under a different prefix/version, or (c) leave them alone and layer middleware. Option (a) is cleanest for anything beyond trivial customization, but it means you now own the contract — document that.
Version your surface area. If the adapter doesn't already prefix with v1, add it at the route group level. Presentation adapters are the most likely thing to change shape, and consumers need a stable prefix.
Composition with other modules. In a modular Liberu-style app, profiles will be referenced by accounts, teams, or auth. Pass IDs/DTOs across boundaries rather than Eloquent models. If the adapter exposes a profile lookup, other modules should consume it through the domain service, not by hitting the API internally — avoid HTTP calls to yourself.
Middleware placement matters. Auth (auth:sanctum), throttling, and authorization policies belong on the route group. Check what the package registers by default; it is common for presentation adapters to ship with minimal middleware and expect the host app to add auth.
Testing pattern. Use HTTP feature tests against the routes rather than unit-testing controllers:
public function test_profile_show_returns_expected_shape(): void
{
$user = User::factory()->create();
$profile = Profile::factory()->for($user)->create();
$this->actingAs($user)
->getJson("/api/profiles/{$profile->id}")
->assertOk()
->assertJsonStructure(['data' => ['id', 'name', /* ... */]]);
}
Use RefreshDatabase and seed through the domain package's factories, not raw inserts.
Config-driven toggling. If a profiles-api.php config exists, use it to disable endpoints you don't need rather than deleting routes — this keeps upgrades sane.
NOASSERTION. This is the single biggest risk. Before production use, verify the actual license terms in the repository (LICENSE file, composer.json license field, or contact the maintainer). Absent a clear license, you do not have unambiguous rights to use it commercially.composer.json ("liberusoftware/profiles-api": "1.2.3"), not a caret range. Consider forking or vendoring if you depend on it seriously.composer show liberusoftware/profiles-api --all
Mismatched or untagged releases are a sign of an unstable release process.api/profiles/* routes, the package's registration order determines which wins. Check php artisan route:list --path=profiles for duplicates and resolve by disabling one side.dont-discover is set in your root composer.json, or you're on an older Laravel, the provider won't register and routes will 404 with no error. Register it manually in bootstrap/providers.php / config/app.php.php artisan route:cache will fail in production. Test route:cache and route:clear as part of your deploy pipeline, not just locally.route:list → check middleware on the failing route → check provider registration in php artisan about → check container bindings with php artisan tinker resolving the controller's dependencies directly → check the domain layer is migrated and seeded. This sequence finds 90% of issues.vendor/.If you find yourself fighting the adapter's opinions for more than a day, it is usually cheaper to write the handful of controllers yourself against a stable domain module than to keep bending a zero-adoption package — the adapter's surface area is small by design.
How can I help you explore Laravel packages today?