StationController.php 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. <?php
  2. namespace App\Http\Controllers;
  3. use App\Station;
  4. use Illuminate\Database\Eloquent\Builder;
  5. use Illuminate\Http\Request;
  6. class StationController extends Controller
  7. {
  8. /**
  9. * Display a listing of the resource.
  10. *
  11. * @return void
  12. */
  13. public function index()
  14. {
  15. }
  16. public function monitorIndex()
  17. {
  18. $stations = Station::query()->with('type:name','parent:name')->whereHas('type',function($query){
  19. /** @var Builder $query */
  20. $query->where('name','料箱监视器');
  21. })->paginate(100);
  22. return view('station.monitor.index',compact('stations'));
  23. }
  24. /**
  25. * Show the form for creating a new resource.
  26. *
  27. * @return \Illuminate\Http\Response
  28. */
  29. public function create()
  30. {
  31. //
  32. }
  33. /**
  34. * Store a newly created resource in storage.
  35. *
  36. * @param \Illuminate\Http\Request $request
  37. * @return \Illuminate\Http\Response
  38. */
  39. public function store(Request $request)
  40. {
  41. //
  42. }
  43. public function show(Station $station)
  44. {
  45. //
  46. }
  47. public function monitorShow(Station $station)
  48. {
  49. return view('station.monitor.show',compact('station'));
  50. }
  51. /**
  52. * Show the form for editing the specified resource.
  53. *
  54. * @param \App\Station $station
  55. * @return \Illuminate\Http\Response
  56. */
  57. public function edit(Station $station)
  58. {
  59. //
  60. }
  61. /**
  62. * Update the specified resource in storage.
  63. *
  64. * @param \Illuminate\Http\Request $request
  65. * @param \App\Station $station
  66. * @return \Illuminate\Http\Response
  67. */
  68. public function update(Request $request, Station $station)
  69. {
  70. //
  71. }
  72. /**
  73. * Remove the specified resource from storage.
  74. *
  75. * @param \App\Station $station
  76. * @return \Illuminate\Http\Response
  77. */
  78. public function destroy(Station $station)
  79. {
  80. //
  81. }
  82. }