UserController.php 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. <?php
  2. namespace App\Http\Controllers\API;
  3. use App\Http\Controllers\Controller;
  4. use Illuminate\Http\Request;
  5. use Illuminate\Support\Facades\DB;
  6. use App\Models\User;
  7. class UserController extends Controller
  8. {
  9. /**
  10. * Display a listing of the resource.
  11. *
  12. * @return \Illuminate\Http\Response
  13. */
  14. public function index()
  15. {
  16. //
  17. $user = User::all()->pluck('name', 'user_id');
  18. return $user;
  19. }
  20. /**
  21. * Show the form for creating a new resource.
  22. *
  23. * @return \Illuminate\Http\Response
  24. */
  25. public function create()
  26. {
  27. //
  28. }
  29. /**
  30. * Store a newly created resource in storage.
  31. *
  32. * @param \Illuminate\Http\Request $request
  33. * @return \Illuminate\Http\Response
  34. */
  35. public function store(Request $request)
  36. {
  37. //
  38. }
  39. /**
  40. * Display the specified resource.
  41. *
  42. * @param int $id
  43. * @return \Illuminate\Http\Response
  44. */
  45. public function show($id)
  46. {
  47. $results = DB::select('SELECT * FROM [permissions].[dbo].[User] WHERE [UserID] = ?', array($id));
  48. return json_encode($results, JSON_UNESCAPED_UNICODE);
  49. }
  50. /**
  51. * Show the form for editing the specified resource.
  52. *
  53. * @param int $id
  54. * @return \Illuminate\Http\Response
  55. */
  56. public function edit($id)
  57. {
  58. //
  59. }
  60. /**
  61. * Update the specified resource in storage.
  62. *
  63. * @param \Illuminate\Http\Request $request
  64. * @param int $id
  65. * @return \Illuminate\Http\Response
  66. */
  67. public function update(Request $request, $id)
  68. {
  69. //
  70. }
  71. /**
  72. * Remove the specified resource from storage.
  73. *
  74. * @param int $id
  75. * @return \Illuminate\Http\Response
  76. */
  77. public function destroy($id)
  78. {
  79. //
  80. }
  81. }