Weave Code
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 Apiable Laravel Package

open-southeners/laravel-apiable

View on GitHub
Deep Wiki
Context7
4.3.0

Added

  • AssertableJsonApi::data(Closure) — scope into the data member using the full AssertableJson fluent API (where, has, missing, count, etc, dd, dump, when, tap, …)
  • AssertableJsonApi::meta(Closure) — scope into meta
  • AssertableJsonApi::links(Closure) — scope into links
  • AssertableJsonApi::errors(Closure) — scope into errors
  • AssertableJsonApi::included(Closure) — scope into included
  • AssertableJsonApi::relationship(string $name, Closure) — scope into relationships.{name}.data of the current resource
  • AssertableJsonApi::at(int $position, Closure $callback) — optional closure variant; when a callback is supplied the method runs assertions inside that scope and returns $this (the collection) for further chaining
  • AssertableJsonApi::atRelation(Model $model, Closure $callback) — optional closure variant on atRelation
  • AssertableJsonApi::assertIsJsonApiDocument() — validates the top-level JSON:API document structure (requires at least one of data/errors/meta; data and errors must not coexist; included requires data)
  • Error documents (errors, no data) are now accepted by fromTestResponse and can be asserted via errors()

Changed

  • AssertableJsonApi constructor is now aligned with the parent AssertableJson(array $props, ?string $path = null). All JSON:API state (id, type, attributes, relationships, included) is now derived from props via accessors instead of stored as separate fields. As a result, parent methods scope(), first(), each(), where(), has(), missing(), count(), etc(), dd(), dump(), when(), tap() are now fully functional on AssertableJsonApi instances.
  • fromTestResponse no longer silently collapses a collection response to the first item. Calling hasAttribute(), hasId(), hasType(), or relationship methods directly on a collection root now operates on the root document, not the first item. Use ->at(0) to scope into a specific collection item before running those assertions.
  • hasAttribute($name, $value) value comparison tightened. The old implementation used assertContains($value, $attributes) which matched the value against any attribute — regardless of key. The new implementation uses assertSame($value, $attributes[$name]) which correctly checks the exact key/value pair. Action required: any test that relied on the old loose matching (e.g. hasAttribute('subtitle', 'Hello') passing because a different key happened to hold 'Hello') needs to be corrected.
  • hasAttribute($name, $value) skipping falsy values fixed. The old guard was if ($value), which skipped the value check when $value was 0, false, or ''. The guard is now if ($value !== null), so values of 0 and false are correctly asserted.
  • toArray() now returns the full document props (delegating to AssertableJson::toArray()) instead of only the attributes of the current resource. Code that called ->toArray() to obtain attributes should use ->toArray()['data']['attributes'] or ->prop('data.attributes').
  • hasNotAttribute($name, $value) semantics clarified. Without $value, asserts the attribute key is absent. With $value, asserts that either the key is absent or the key's value differs from $value. Previously the method always failed if the key existed, even when only checking that a specific value was not present.
  • hasAttributes() now accepts both list form (['title', 'abstract'] — key existence only) and map form (['title' => 'Hello'] — key + exact value).

Fixed

  • scope(), first(), each() from the parent now work correctly because the constructor matches the parent signature
  • AssertableJsonApi::rootProps is threaded into child scopes so included, meta, and links are reachable from any scope depth
4.2.0

Added

  • Apiable::modelResourceMap() to register custom JsonApiResource classes per model globally
  • Apiable::jsonApiResourceFor() to resolve the registered resource class for a given model instance
  • JsonApiResponse::usingResource() to override the resource class used for serialization per-response
  • JsonApiResource::toApplicationJsonArray() for plain JSON serialization merging model attributes with computed ones

Fixed

  • Related models in included relationships now resolve through the resource registry instead of always using the base JsonApiResource class
  • Pivot relationship meta keys were not being prefixed correctly (array_walk callback was not returning the modified array); replaced with an explicit loop
4.1.0

Added

  • Multiple scoped filters parameters values (e.g. /?filter[withStatuses]=Active&filter[withStatuses]=Archived) (#15)

Fixed

  • Issue when included repeated relationships replaced others (#11)
4.0.0

Added

  • apiable:docs command to generate API documentation from PHP attributes in Postman v2.1, Markdown/MDX, and OpenAPI 3.1 formats
  • $description property to all *QueryParam attributes for documentation generation
  • #[DocumentedResource], #[DocumentedEndpointSection], and #[EndpointResource] PHP attributes for annotating controllers
  • OpenSoutheners\LaravelApiable\Documentation\Generator class for building resource documentation trees from registered routes
  • OpenSoutheners\LaravelApiable\Http\JsonApiPaginator class exposing pagination logic as a typed static method
  • Laravel 13 support

Fixed

  • Handler::includesTrace() was calling env('APP_DEBUG') outside of the config directory, which returns null in production; now uses config('app.debug')
  • IteratesResultsAfterQuery had leaked application-specific imports (App\Domain\Process\Models\Box\Box, App\Models\ModelForm) left over from a real project
  • addAppendsToResult() instanceof JsonApiCollection check was unreachable because it was nested inside an instanceof JsonApiResource branch (since JsonApiCollection extends JsonApiResource); logic restructured to check the most-specific subtype first
  • addAppendsToResult() instanceof Paginator branch was using the Paginator contract which does not declare through(); changed to AbstractPaginator
  • CollectsResources::collects() was missing a return null fallback, causing PHPStan to report a missing return statement
  • isScope() in ApplyFiltersToQuery was using get_parent_class() to exclude base builder methods, which could return false for unknown types; now diffs against Illuminate\Database\Eloquent\Builder::class directly, which is also more accurate
  • Various PHPDoc type corrections in documentation exporters and Generator (malformed class name OpenSouthenersLaravelApiableDocumentationResource\OpenSoutheners\LaravelApiable\Documentation\Resource)

Removed

  • Laravel 11 support
3.17.1

Fixed

  • Exceptions handler at issue #20
3.17.0

Added

  • Appends to raw JSON responses
3.16.4

Fixed

  • URL params getting double encoded
3.16.3

Fixed

  • Laravel param inconsistency with paginator page number also applies to FastPaginate
3.16.2

Fixed

  • Pagination returns wrong page name query parameter (Laravel framework is inconsistent around this)
3.16.1

Fixed

  • Apiable::toJsonApi() given collection as input returns empty response
3.16.0

Fixed

  • jsonApiPaginate() method typos
3.15.1

Fixed

  • Page number resolver not properly retrieved for jsonApiPaginate() method
  • Fast paginate package with new name and namespace check
3.15.0

Added

  • Laravel 12 support

Removed

  • Laravel 9 and 10 support
  • PHP 8.0 and 8.1 support
3.14.2

Changed

  • Replaced package open-southeners/laravel-helpers with open-southeners/extended-php
3.14.1

Fixed

  • Performance degradation issue on serialisation (infinite loop on nested includeds)
3.14.0

Added

  • Laravel 11 support
3.13.3

Fixed

  • Raw response without pagination returning query builder
3.13.2

Added

  • Raw response formatting to JsonApiResponse
3.13.1

Added

  • Type generics into:
    • OpenSoutheners\LaravelApiable\Http\JsonApiResponse
    • OpenSoutheners\LaravelApiable\Http\RequestQueryObject
    • OpenSoutheners\LaravelApiable\Http\Resources\JsonApiResource
    • OpenSoutheners\LaravelApiable\Http\Resources\JsonApiCollection
    • OpenSoutheners\LaravelApiable\Contracts\ViewQueryable
    • OpenSoutheners\LaravelApiable\Contracts\ViewableBuilder
3.13.0

Added

  • Handler::withHeader (used as apiable()->jsonApiRenderable()->withHeader) to add headers to JSON errors
3.12.0

Added

  • Includes relationships counts with tags_count (needs to end with _count). E.g:
JsonApiResponse::using(Post::class)->allowInclude(['tags_count']);

// Then request this with ?include=tags_count

Fixed

  • Some IDEs getting confused with returning self types in traits (replaced to static)
3.11.5

Changed

  • Fix open-southeners/laravel-helpers utilities package version constrain so other packages can use similar versions under the same major release
3.11.4

Fixed

  • Query withCount method usage with apiable is replacing the underlying added selects for these counts
3.11.3

Fixed

  • Force formatting always coming through even thought is not forced by config
3.11.2

Changed

  • Config file now with response.formatting with type and force sub-items as options

Fixed

  • Force formatting for Inertia based apps (now can use Apiable::forceResponseFormatting())
3.11.1

Fixed

  • Non existing class ForceAppendAttribute when reading controller attributes
3.11.0

Added

  • Default sorts using JsonApiResponse::applyDefaultSort method or OpenSoutheners\LaravelApiable\Attributes\ApplyDefaultSort attribute
  • Default filters using JsonApiResponse::applyDefaultFilter method or OpenSoutheners\LaravelApiable\Attributes\ApplyDefaultFilter attribute
  • Default formatting bypass using JsonApiResponse::forceFormatting method

Changed

  • Request::wantsJsonApi() only looks at Accept header, not looking for Content-Type one anymore
  • Now all requests can send a different Accept header if they want a diffent response formatting. For e.g. sending Accept: application/json will get raw JSON response. Default being configured in the config/apiable.php make sure to publish or update it
3.10.0

Added

  • Sorts now accepts relationships (for e.g. /posts?sort=tags.created_at)
3.9.2

Fixed

  • PHP deprecation warning on string vars interpolation
3.9.1

Fixed

  • JsonApiResponse using viewable builder (query scopes to filter by view permission) didn't send any user as first parameter
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.
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge
l3aro/rating-star-for-filament
leek/filament-subtenant-scope