Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Php Api Wrapper

Php Api Wrapper Laravel Package

cristal/php-api-wrapper

cristal/php-api-wrapper is a Laravel/PHP package for building clean, reusable API clients. It offers a fluent interface for requests and responses, supports caching, retries, logging, and testing, and helps keep external API integrations organized and maintainable.

View on GitHub
Deep Wiki
Context7

:rainbow: Work with APIs like with Laravel Eloquent or Doctrine (no longer a dream)

Frequently asked questions about Php Api Wrapper
What is cristal/php-api-wrapper and how does it work with Laravel?
cristal/php-api-wrapper is a Laravel/PHP package for building clean, reusable API clients. It maps remote HTTP resources onto ORM-shaped models and a fluent query builder, so developers can write Eloquent-style calls such as Model::where(...)->get() against a REST API. It is an ergonomics layer over HTTP rather than an infrastructure package, and it is intended to keep external API integrations organized and maintainable.
How do I install cristal/php-api-wrapper in a Laravel application?
Install it with Composer using the package name cristal/php-api-wrapper, then follow its Laravel service-provider and configuration conventions. The assessment describes integration as mechanically low-friction and MIT-licensed. Before committing, check the declared PHP and Laravel constraints and confirm it installs cleanly on your current and next framework versions.
Which Laravel and PHP versions does cristal/php-api-wrapper support?
The provided assessment does not list specific PHP or Laravel version constraints. It explicitly recommends checking the declared constraints in the package metadata and testing installation against your current and next Laravel version. Because the last release was 2023-04-28, compatibility with newer Laravel releases should be verified rather than assumed.
What API use cases is cristal/php-api-wrapper best suited for?
It fits best when you have many third-party APIs with homogeneous, read-heavy shapes such as list, detail, filter, and paginate operations. It can also be reasonable for CRUD-over-REST admin tooling and internal service aggregation. It is a poor fit for one or two integrations, GraphQL, streaming, webhook-first systems, auth-heavy flows, or latency-sensitive high-QPS paths where the ORM-style surface can hide network I/O.
Does cristal/php-api-wrapper support caching, retries, logging, and testing?
The package advertises a fluent request and response interface with support for caching, retries, logging, and testing. However, the assessment flags the test story as unverified, so confirm whether it provides an HTTP fake or mock layer and whether that integrates with Laravel's HTTP client fakes. Validate caching and retry behavior against your target APIs before relying on them in production.
How does cristal/php-api-wrapper handle API errors and non-2xx responses?
The provided assessment does not specify how cristal/php-api-wrapper surfaces non-2xx responses. You need to confirm whether it uses typed exceptions, ORM-style not-found behavior, or silent nulls. Pay particular attention to rate-limit responses such as 429s, because treating them like validation errors or missing records can hide real operational problems.
Does cristal/php-api-wrapper handle authentication, OAuth2, rate limits, and timeouts?
Authentication and transport security are not owned by this package; credentials are passed through to the underlying HTTP client. The assessment notes that OAuth2-with-refresh, mTLS, HMAC, and similar auth-heavy flows are a poor fit because auth is the value and the package does not manage it. You must also confirm where retry, backoff, timeout, and rate-limit handling live and verify that secrets are not logged, serialized into model state, or leaked in exceptions.
Is cristal/php-api-wrapper actively maintained and safe for production?
The assessment rates abandonment risk as high: it is maintained by a single organization, had a last release on 2023-04-28, and has roughly 126 stars and zero dependents. There is no production corpus to lean on and no security advisory pipeline you can rely on. Treat framework-upgrade compatibility as something you may need to validate or fork yourself.
Can cristal/php-api-wrapper cause N+1 requests or hidden API fan-out?
Yes, that is a medium-high risk called out in the assessment. Lazy hydration and relation-like traversal can turn a small code change into a request storm that is invisible in code review. Check whether any relation or eager-loading feature batches requests or loops, and guard against implicit request fan-out in latency-sensitive paths.
How do I mock or fake API requests when testing cristal/php-api-wrapper?
The assessment says the test story is unverified and recommends confirming whether the package provides a request-faking or mocking primitive integrated with Laravel's HTTP client fakes. If it does not, your test suite may become network-coupled and flaky. Ask the maintainer or inspect the source before adopting it for a test-heavy Laravel codebase.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
robertmarney/lara-hierarchial-collections
simonschaufi/rule-doc-generator
emissaoja/emissaoja
blackbricksoftware/gravityforms-civicrm-form-processor
al-rahabi/fancy-crud
jinas/dhivatar-component
mltstephane/laravel-quality
bernskiold/laravel-talentlms
bernskioldmedia/laravel-form-architect
youbar/easy-crud
c-point-labs/laravel-hostyourai
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo