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
Laravel Api

Laravel Api Laravel Package

joselfonseca/laravel-api

A Laravel package for building JSON APIs with reusable controllers, resources, response helpers, and consistent error handling. It reduces boilerplate and helps keep API endpoints structured and predictable.

View on GitHub
Deep Wiki
Context7

joselfonseca/laravel-api is a Laravel package for building APIs that follow the JSON:API specification. It provides base resource, controller, and routing classes so you can expose models and relationships with consistent, standards-compliant responses instead of hand-crafting payloads.

  • Base classes for resources, collections, and controllers
  • Automatic relationship handling and inclusion
  • Built-in pagination, filtering, and sorting support
  • Standards-compliant error responses
  • Configurable routing and serialization
Frequently asked questions about Laravel Api
What is joselfonseca/laravel-api?
It is a Laravel API starter kit that gives you a base controller, a standardized JSON response envelope, centralized exception-to-JSON handling, and Fractal-style transformers out of the box. The goal is to remove boilerplate so you can focus on endpoints and business logic. It is an opinionated application scaffold rather than a runtime library, so you clone or fork it and own the codebase outright.
How do I install joselfonseca/laravel-api?
You do not run composer require in a production project. Instead you clone or fork the repository, run composer install, configure your .env file, and run migrations against a fresh database. Time to a first working endpoint is measured in hours. The real work comes afterward when reconciling its conventions with your auth, CI/CD, and observability stack.
Does joselfonseca/laravel-api support Laravel 11 or Laravel 12?
No. The project is archived with a final release around August 2022, so it targets the Laravel application skeleton of that era. Laravel has since changed its directory layout, HTTP kernel, and bootstrap defaults, so some of what the repo teaches about where files go is now out of date. Expect a real upgrade effort if you want to run it on a modern Laravel version.
Is joselfonseca/laravel-api still maintained?
No, it is archived and receives no security patches, Laravel compatibility updates, or maintainer responses. With roughly 423 stars and zero dependents, there is also no community bug-finding corpus or de facto support channel. Treat every line as unmaintained code that you are adopting and owning forever.
How does joselfonseca/laravel-api handle JSON error responses?
It centralizes exception handling and converts errors into a consistent JSON response envelope so clients see the same structure for both successes and failures. That convention is one of the main pieces of value in the repo, and it is small enough to extract and reuse. If you only want the error and response conventions, copy those classes and rebuild them on a current Laravel version rather than forking the whole skeleton.
How is this different from Laravel's built-in API Resources?
This starter kit uses a Fractal-style transformation layer plus a response envelope, while modern Laravel ships first-party API Resources and resource collections. If your team has already standardized on Laravel API Resources, the value of this package's conventions is close to zero. It is a better fit for teams that want fractal-style transformers and decided-up-front conventions.
Can I use joselfonseca/laravel-api in production?
You can, but you are adopting unmaintained code into a new service with no upstream to escalate to. Run a security audit on retained dependencies, since a 2022 dependency tree may include abandoned transitive packages or known CVEs. Also assign an internal owner who is accountable for the code long term, because no maintainer will respond.
What testing support does joselfonseca/laravel-api include?
It ships with the testing helpers and dev tooling that were typical of a 2022 Laravel application. Those versions will not match current PHPUnit or Pest releases, so expect to migrate the test setup to modern Laravel conventions. The testing layer is also a place where the skeleton has drifted from current Laravel defaults.
Is joselfonseca/laravel-api a good fit for a small CRUD team or a DDD-style architecture?
Its layered domain-oriented structure and thin controllers suit teams with DDD-leaning architects who want conventions decided up front. For a small CRUD team it will likely feel like over-engineering. It is also a poor fit for monoliths with server-rendered views or organizations that already have an internal Laravel template.
What are the alternatives to joselfonseca/laravel-api, and is there a migration path?
The main alternatives are a fresh Laravel application skeleton with first-party API Resources, or another actively maintained API starter kit. A practical migration path is to harvest the transformer, exception handler, and response-envelope patterns and rebuild them on Laravel 12. If the files you actually want are fewer than about ten, extract the patterns and skip forking the whole project.
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.
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
bernskioldmedia/laravel-harvest
bernskiold/laravel-data-scrubber
bernskiold/laravel-currency-converter
bernskiold/laravel-campaign-monitor
bernskioldmedia/laravel-autotranslate
siberfx/telegram-bot
roy-sandip/laravel-view-extended
gregsphotography/site-builder-core
roy-sandip/laravel-view
anodyne/blade-fluentui-icons
webx-ui/module-catalog-collections