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

Smart Response Laravel Package

quonain/smart-response

SmartResponse is a Laravel package that returns JSON API responses or Blade/Inertia views from the same controller method, auto-detecting request type (Accept header, /api routes, bearer tokens). Includes pagination, response shortcuts, macros, caching, and meta enrichment.

View on GitHub
Deep Wiki
Context7
1.1.1

Changed

  • Comprehensive README update: table of contents, detection guide, helper reference tables, v1.1 feature docs, Packagist sync note
1.1.0

Added

  • HTTP shortcut helpers: created(), noContent(), notFound(), unauthorized(), forbidden()
  • Trait helpers: smartCreated(), smartNoContent(), smartNotFound(), etc.
  • Global helpers: smart_created(), smart_not_found()
  • Response macros: response()->smartCreated(), response()->smartNotFound()
  • API meta enrichment (timestamp, request ID, optional API version) via MetaEnricher
  • Bearer token requests auto-detected as API (detection.bearer_as_api)
  • Cursor pagination meta support
  • Retry-After header on rate-limit responses
  • Extra translation keys for common errors

Fixed

  • Custom response headers now apply correctly on JSON responses
  • 204 No Content returns an empty body
1.0.1

Added

  • Laravel 13 support (illuminate/* ^13.0, orchestra/testbench ^11.0)
1.0.0

Added

  • Initial release of SmartResponse Laravel package
  • Unified API / Web response handling with automatic request detection
  • HasSmartResponse trait and smart_response() helper
  • Standardized JSON API structure with optional XML support
  • Pagination, Resource, and Collection support
  • Validation error formatting
  • Exception handler integration for API requests
  • Flash messages and optional toast notifications for web
  • Inertia.js and Livewire optional adapters
  • Response macros, events, logging hooks, and response caching
  • Rate limit response helper and OpenAPI examples
  • Pest PHP test suite
  • Full configuration publishing and Laravel auto-discovery
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.
octoberrain/html
octoberrain/extension
octoberrain/exception
octoberrain/contracts
frankyso/ipaymu
3mdikram/worldmoneywords
snowsoft/config
itmosoft/laravel-subscriptions
larva/laravel-ai-qwen
diephp/sequences
users-au/socialite-provider
twidpay/twid-logger
mrnewport/laravel-plaid
mrnewport/laravel-repo
mrnewport/laravel-docsign
mrnewport/laravel-stow
mrnewport/laravel-flow
mrnewport/laravel-priceable
mrnewport/laravel-nestedterms
fredmeng/laravel-apidoc-generator