Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Automatically always return a response in JSON format

License

NotificationsYou must be signed in to change notification settings

TheDragonCode/laravel-json-response

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Json Response for Laravel

Stable VersionUnstable VersionTotal DownloadsGithub Workflow StatusLicense

Automatically always return a response in JSON format

Installation

To get the latest version ofLaravel Json Response, simply require the project usingComposer:

composer require dragon-code/laravel-json-response

Or manually updaterequire block ofcomposer.json and runcomposer update.

{"require": {"dragon-code/laravel-json-response":"^2.0"    }}

Using

After you've installed the package via composer, you're done. There's no step two.

This package will automatically register theDragonCode\LaravelJsonResponse\Middlewares\SetHeaderMiddleware middleware in theweb andapi groups, if they exist. Themiddleware will add a headerAccept that will effectively convert all responses to JSON format. This header will apply to all responses.

If you need to redefine the header for specific groups of routes, you can do this by changing thesettings.

About

Automatically always return a response in JSON format

Resources

License

Contributing

Stars

Watchers

Forks

Sponsor this project

    Contributors5

    Languages


    [8]ページ先頭

    ©2009-2025 Movatter.jp