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
Rest Api Bundle

Rest Api Bundle Laravel Package

riddle/rest-api-bundle

A Symfony bundle for building REST APIs, giving you a structured foundation for controllers, request handling, and JSON responses. It helps you expose resources quickly, keep endpoints consistent, and cut boilerplate so your API stays clean and maintainable across your Symfony application.

View on GitHub
Deep Wiki
Context7

A bundle which provides your project with useful REST API functions

Frequently asked questions about Rest Api Bundle
What is riddle/rest-api-bundle and what does it do?
Riddle RestApiBundle is a Symfony bundle for building REST APIs, providing standardized JSON response helpers, HTTP status handling, and consistent exception-to-JSON formatting so controllers stay thin. It integrates through Symfony's kernel, dependency injection container, and event dispatcher rather than Laravel's service providers or middleware. For Laravel developers it is best treated as a pattern reference, not a drop-in library.
Is riddle/rest-api-bundle compatible with Laravel?
No. The package registers as a Symfony bundle, and Laravel offers no supported seam for a Symfony bundle to hook into its service container, routing, or middleware pipeline. Laravel's extension points are service providers, facades, and middleware, none of which the bundle targets. Any attempt to load it in a Laravel application should be treated as unsupported.
Can I install riddle/rest-api-bundle with Composer in a Laravel project?
A composer require attempt will most likely fail dependency resolution, because the bundle pulls a symfony/framework-bundle constraint that conflicts with the Symfony components Laravel already ships. Forcing the install with --ignore-platform-reqs is a hard stop rather than a workaround, since it only defers the failure to runtime. If you want to study the code, clone the repository instead of installing it into the app.
Which PHP and Symfony versions does riddle/rest-api-bundle support?
The repository does not publish a clear compatibility matrix, so you must read composer.json for the PHP constraint, the symfony/framework-bundle constraint, transitive dependencies, and the license. The bundle looks like a Symfony 2 or 3 era package, which typically conflicts with modern PHP 8.x and current Symfony components. Assume incompatible until a throwaway branch proves otherwise.
Is riddle/rest-api-bundle actively maintained and safe for production use?
There is no evidence of active maintenance: zero stars, zero dependents, and no visible CVE triage or release cadence. Adopting it makes your team the sole owner of the code on day one, so bus factor and supply-chain risk land entirely on you. That is tolerable for reading the source as a reference, but it is fatal for adding it as a runtime dependency.
What Laravel features already cover what riddle/rest-api-bundle provides?
Laravel's native API surface covers the plausible scope of a REST API helper bundle: routes/api.php for routing, API Resources for serialization, Form Requests for validation, Sanctum or Passport for auth, built-in rate limiting, cursor pagination, and a configurable exception handler. Adding a Symfony bundle would introduce a second mental model for zero incremental capability. Most of the bundle's value can be reproduced natively in a few hours.
How do I build a consistent JSON error envelope and exception handler in Laravel?
Implement it once in your exception handling layer: in Laravel 11 and later that means the withExceptions closure in bootstrap/app.php, and in older versions the render method of app/Exceptions/Handler.php. Return a stable JSON shape such as message, errors, and status, and let validation exceptions from Form Requests flow through the same renderer. Add a small base controller trait or a response macro so success payloads share the same envelope.
How do I test Laravel REST API endpoints and JSON responses without this bundle?
Use Laravel's HTTP test helpers with PHPUnit or Pest: getJson, postJson, putJson, and deleteJson alongside assertions like assertStatus, assertJsonStructure, assertJsonPath, and assertJsonValidationErrors. These cover status codes, JSON shape, and validation failures without any additional package. Feature tests against routes/api.php give you the same coverage a bundle would claim to provide.
What are the best alternatives to riddle/rest-api-bundle for building Laravel APIs?
For Laravel the strongest alternative is the framework itself, optionally extended with focused packages such as Laravel Sanctum for token auth, spatie/laravel-query-builder for filtering and sorting, and spatie/laravel-data if you want typed data objects. If you need OpenAPI documentation, pick a dedicated documentation package rather than a general REST helper. None of these require adopting Symfony bundle conventions.
Should I adopt riddle/rest-api-bundle or use it as a reference pattern only?
Use it as a reference pattern only. Read the JSON response helpers and the exception listener, then reimplement the envelope, error formatting, and pagination helpers natively with API Resources, Form Requests, and your exception handler. Record the outcome as a documented do-not-adopt decision so future dependency intake has a concrete example of maintenance, license, and compatibility criteria.
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.
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console