Last active
July 27, 2023 11:09
-
-
Save Mahendran-Balaji/e676c5d5d81ff686906220962fe3a678 to your computer and use it in GitHub Desktop.
Example for 'How to use laravel default response code ?'
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Open Response.php File From vendor/Symfony/http-foundation/ */ | |
1) Refer attached File of Response.php | |
class Response | |
{ | |
public const HTTP_CONTINUE = 100; | |
public const HTTP_SWITCHING_PROTOCOLS = 101; | |
public const HTTP_PROCESSING = 102; // RFC2518 | |
public const HTTP_EARLY_HINTS = 103; // RFC8297 | |
public const HTTP_OK = 200; | |
public const HTTP_CREATED = 201; | |
public const HTTP_ACCEPTED = 202; | |
.......... | |
} | |
2) Add Triat in the controller : use Illuminate\Http\Response; | |
3) Call Constant variable: Response::HTTP_NO_CONTENT / Response::HTTP_OK |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment