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
Laravel5 Json Api

Laravel5 Json Api Laravel Package

nilportugues/laravel5-json-api

Laravel 5 package for building APIs that follow the JSON API specification (jsonapi.org). It transforms Eloquent models and collections into spec-compliant responses, including relationships, pagination, errors, and content negotiation, with minimal setup and configuration.

View on GitHub
Deep Wiki
Context7

Laravel 5 JSON API brings the JSON API specification to Laravel applications. It provides serializers and transformers that map Eloquent models and collections into spec-compliant data, relationships, and included documents, along with error objects and proper HTTP status handling.

  • Spec-compliant compound document serialization
  • Reusable transformers for models and collections
  • Built-in pagination support
  • Consistent error response helpers
  • Laravel 5 service provider and facade integration
Frequently asked questions about Laravel5 Json Api
What is nilportugues/laravel5-json-api used for?
It is a Laravel 5 package for building JSON API-compliant API responses. It provides response builders, transformers, error handling, and resource serialization for documents with data, included, links, meta, and errors. It is a serializer wrapper, not a full API framework, so authentication, authorization, filtering, sorting, pagination policy, validation, and routing remain application responsibilities.
How do I install nilportugues/laravel5-json-api in Laravel?
Basic integration is typically a Composer require, publishing package configuration, defining transformer classes, and wiring the exception handler. Before installing, check the package composer.json constraints against your exact Laravel and PHP versions, because the 2016 release predates modern runtimes. Pin versions and commit the lock file if you use it in a legacy application.
Does nilportugues/laravel5-json-api support Laravel 6, 7, 8, or newer?
It targets Laravel 5.x-era applications and was last released in August 2016. It is a poor fit for Laravel 6+ or PHP 7.4/8.x estates unless forked and modernized. Do not assume Laravel 5.5+ or modern PHP support without a compatibility spike.
Is nilportugues/laravel5-json-api maintained?
No. The last release was in August 2016, it has zero dependent repositories in the assessment, and there is no upstream security-patch path. Stars do not substitute for maintenance activity. Treat it as legacy or reference code, not a strategic dependency for new work.
How do I create JSON API responses with transformers in Laravel?
You define transformer classes for your Eloquent models and use the package response builders to produce JSON API-style documents. The package handles resource serialization and structures such as data, included, links, meta, and errors. You still own relationship loading strategy, pagination policy, and response-shape conventions.
Does it handle JSON API errors and validation exceptions?
The package provides error handling and JSON API error-object support, but validation-error mapping and exception-handler behavior must be proven in your application. Laravel 5 exception handling differs from modern Laravel, so test validation failures, authorization errors, and not-found responses. Keep error mapping behind your own layer to avoid inconsistent responses.
Can it handle compound documents, sparse fieldsets, and pagination links?
The package targets JSON API-style documents that can include included resources, links, and meta, but you must verify compound documents, sparse fieldsets, and pagination links against your required spec profile. Pagination policy and relationship loading remain application-owned. Contract tests should catch N+1 queries and response-shape regressions.
How should I test JSON API compliance with this package?
Write contract tests that assert the exact JSON API response shape, error objects, included resources, links, and meta for representative endpoints. Test oldest and newest Laravel and PHP versions in your matrix, including exception handling, middleware, and Eloquent relationship loading. These tests are essential because the package is unmaintained and spec drift or upgrade breakage is likely.
What are the production risks of using nilportugues/laravel5-json-api?
The main risks are Composer dependency conflicts, PHP and Laravel upgrade failure, JSON API spec drift, inconsistent error responses, N+1 queries in compound documents, and serialization recursion or memory pressure. Because it is abandoned, there is no security-patch path. Pin exact versions, isolate it behind a feature flag or anti-corruption layer, and plan an exit.
Should I fork nilportugues/laravel5-json-api or replace it with an alternative?
Prefer a maintained JSON API library or a thin custom serializer behind an internal interface for modern Laravel. Fork only if an existing Laravel 5 application has a firm JSON API requirement and you can assign ownership for CI, security patching, and upgrade testing. Otherwise replace it rather than carrying an unmaintained dependency.
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