Resource.php 506 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. namespace App\Http\Resources;
  3. use Illuminate\Http\Resources\Json\Resource as BaseResource;
  4. class Resource extends BaseResource
  5. {
  6. /**
  7. * Transform the resource into an array.
  8. *
  9. * @param \Illuminate\Http\Request $request
  10. * @return array
  11. */
  12. public function toArray($request)
  13. {
  14. return parent::toArray($request);
  15. }
  16. public function with($request)
  17. {
  18. return [
  19. 'code' => 200,
  20. 'message' => 'OK',
  21. ];
  22. }
  23. }