WorkOrdersController.php 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <?php
  2. namespace App\Http\Controllers\Api;
  3. use App\Http\Controllers\Controller;
  4. use App\WorkOrder;
  5. use Illuminate\Http\Request;
  6. class WorkOrdersController extends Controller
  7. {
  8. /**
  9. * Display a listing of the resource.
  10. *
  11. * @return \Illuminate\Http\Response
  12. */
  13. public function index()
  14. {
  15. //
  16. }
  17. /**
  18. * Show the form for creating a new resource.
  19. *
  20. * @return \Illuminate\Http\Response
  21. */
  22. public function create()
  23. {
  24. //
  25. }
  26. /**
  27. * Store a newly created resource in storage.
  28. *
  29. * @param \Illuminate\Http\Request $request
  30. * @return \Illuminate\Http\Response
  31. */
  32. public function store(Request $request)
  33. {
  34. //
  35. }
  36. /**
  37. * Display the specified resource.
  38. *
  39. * @param \App\WorkOrder $workOrder
  40. * @return \Illuminate\Http\Response
  41. */
  42. public function show(WorkOrder $workOrder)
  43. {
  44. return $workOrder;
  45. }
  46. /**
  47. * Show the form for editing the specified resource.
  48. *
  49. * @param \App\WorkOrder $workOrder
  50. * @return \Illuminate\Http\Response
  51. */
  52. public function edit(WorkOrder $workOrder)
  53. {
  54. //
  55. }
  56. /**
  57. * Update the specified resource in storage.
  58. *
  59. * @param \Illuminate\Http\Request $request
  60. * @param \App\WorkOrder $workOrder
  61. * @return \Illuminate\Http\Response
  62. */
  63. public function update(Request $request, WorkOrder $workOrder)
  64. {
  65. $workOrder->probdesc = $request->input('probdesc');
  66. $workOrder->suggested = $request->input('suggested');
  67. $workOrder->storeid = $request->input('storeid');
  68. $workOrder->save();
  69. event(new \App\Events\WorkOrderUpdated($workOrder));
  70. return response()->json($workOrder, 200);
  71. }
  72. /**
  73. * Remove the specified resource from storage.
  74. *
  75. * @param \App\WorkOrder $workOrder
  76. * @return \Illuminate\Http\Response
  77. */
  78. public function destroy(WorkOrder $workOrder)
  79. {
  80. //
  81. }
  82. }