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.
created(), noContent(), notFound(), unauthorized(), forbidden()smartCreated(), smartNoContent(), smartNotFound(), etc.smart_created(), smart_not_found()response()->smartCreated(), response()->smartNotFound()MetaEnricherdetection.bearer_as_api)Retry-After header on rate-limit responses204 No Content returns an empty bodyilluminate/* ^13.0, orchestra/testbench ^11.0)HasSmartResponse trait and smart_response() helperHow can I help you explore Laravel packages today?