-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
addition of new methods and config file
- Loading branch information
Showing
10 changed files
with
192 additions
and
146 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<?php | ||
|
||
use Symfony\Component\HttpFoundation\Response; | ||
|
||
return [ | ||
'toJson' => true, | ||
'responses' => [ | ||
'success' => [ | ||
'success' => true, | ||
'message' => 'messages.success.ok', | ||
'status' => Response::HTTP_OK, | ||
], | ||
'created' => [ | ||
'success' => true, | ||
'message' => 'messages.success.created', | ||
'status' => Response::HTTP_CREATED, | ||
], | ||
'accepted' => [ | ||
'success' => true, | ||
'message' => 'messages.success.accepted', | ||
'status' => Response::HTTP_ACCEPTED, | ||
], | ||
'errors' => [ | ||
'success' => false, | ||
'message' => 'messages.exceptions.unprocessable_entity', | ||
'status' => Response::HTTP_UNPROCESSABLE_ENTITY, | ||
], | ||
'nocontent' => [ | ||
'success' => true, | ||
'message' => 'messages.exceptions.no_content', | ||
'status' => Response::HTTP_NO_CONTENT, | ||
], | ||
'servererror' => [ | ||
'success' => false, | ||
'message' => 'messages.exceptions.server_error', | ||
'status' => Response::HTTP_INTERNAL_SERVER_ERROR, | ||
], | ||
'notfound' => [ | ||
'success' => false, | ||
'message' => 'messages.exceptions.not_found', | ||
'status' => Response::HTTP_NOT_FOUND, | ||
], | ||
'notauthenticated' => [ | ||
'success' => false, | ||
'message' => 'messages.exceptions.not_authenticated', | ||
'status' => Response::HTTP_UNAUTHORIZED, | ||
], | ||
'notauthorized' => [ | ||
'success' => false, | ||
'message' => 'messages.exceptions.not_authorized', | ||
'status' => Response::HTTP_FORBIDDEN, | ||
], | ||
], | ||
]; |
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
|
||
namespace Nnjeim\Respond; | ||
|
||
use Exception; | ||
|
||
class RespondException extends Exception | ||
{ | ||
/** | ||
* @param string $method | ||
* @return static | ||
*/ | ||
public static function methodNotFoundException(string $method) { | ||
|
||
return new static(trans('respond::messages.exceptions.method_not_found', compact('method'))); | ||
} | ||
} |
Oops, something went wrong.