You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
504 B

2 years ago
  1. <?php
  2. namespace App\Http\Resources;
  3. use Symfony\Component\HttpFoundation\Response;
  4. use Illuminate\Contracts\Support\Responsable;
  5. class Successful implements Responsable
  6. {
  7. public static function make()
  8. {
  9. return new static;
  10. }
  11. public function toResponse($request)
  12. {
  13. return response()->json([
  14. 'data' => [
  15. 'code' => Response::HTTP_OK,
  16. 'message' => Response::$statusTexts[Response::HTTP_OK],
  17. ]
  18. ]);
  19. }
  20. }