TestResourceController.php 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. <?php
  2. namespace Mpociot\ApiDoc\Tests\Fixtures;
  3. use Illuminate\Http\Request;
  4. use Illuminate\Routing\Controller;
  5. class TestResourceController extends Controller
  6. {
  7. /**
  8. * Display a listing of the resource.
  9. *
  10. * @response {
  11. * "index_resource": true
  12. * }
  13. *
  14. * @return \Illuminate\Http\Response
  15. */
  16. public function index()
  17. {
  18. return [
  19. 'index_resource' => true,
  20. ];
  21. }
  22. /**
  23. * Show the form for creating a new resource.
  24. *
  25. * @response {
  26. * "create_resource": true
  27. * }
  28. *
  29. * @return \Illuminate\Http\Response
  30. */
  31. public function create()
  32. {
  33. return [
  34. 'create_resource' => true,
  35. ];
  36. }
  37. /**
  38. * Store a newly created resource in storage.
  39. *
  40. * @param \Illuminate\Http\Request $request
  41. *
  42. * @return \Illuminate\Http\Response
  43. */
  44. public function store(Request $request)
  45. {
  46. return [
  47. 'store_resource' => true,
  48. ];
  49. }
  50. /**
  51. * Display the specified resource.
  52. *
  53. * @response {
  54. * "show_resource": true
  55. * }
  56. *
  57. * @param int $id
  58. *
  59. * @return \Illuminate\Http\Response
  60. */
  61. public function show($id)
  62. {
  63. return [
  64. 'show_resource' => $id,
  65. ];
  66. }
  67. /**
  68. * Show the form for editing the specified resource.
  69. *
  70. * @response {
  71. * "edit_resource": true
  72. * }
  73. *
  74. * @param int $id
  75. *
  76. * @return \Illuminate\Http\Response
  77. */
  78. public function edit($id)
  79. {
  80. return [
  81. 'edit_resource' => $id,
  82. ];
  83. }
  84. /**
  85. * Update the specified resource in storage.
  86. *
  87. * @param \Illuminate\Http\Request $request
  88. * @param int $id
  89. *
  90. * @return \Illuminate\Http\Response
  91. */
  92. public function update(Request $request, $id)
  93. {
  94. return [
  95. 'update_resource' => $id,
  96. ];
  97. }
  98. /**
  99. * Remove the specified resource from storage.
  100. *
  101. * @param int $id
  102. *
  103. * @return \Illuminate\Http\Response
  104. */
  105. public function destroy($id)
  106. {
  107. return [
  108. 'destroy_resource' => $id,
  109. ];
  110. }
  111. }