AdminController.php 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. <?php
  2. namespace App\Http\Controllers\Admin;
  3. use App\Http\Controllers\Controller;
  4. use Illuminate\Http\Request;
  5. use App\User;
  6. use Auth;
  7. use Mail;
  8. use Session;
  9. use Hash;
  10. class AdminController extends Controller
  11. {
  12. public function __construct(){
  13. $this->middleware('admin');
  14. }
  15. public function dashboard()
  16. {
  17. $admin = Auth::guard('admin')->user();
  18. $register_teachers_list =User::whereIn(
  19. 'status',[0,2]
  20. )->where(
  21. 'user_type',2
  22. )->orderBy(
  23. 'name','ASC'
  24. )->get();
  25. $active_teachers_list =User::where(
  26. 'status',1
  27. )->where(
  28. 'user_type',2
  29. )->orderBy(
  30. 'name','ASC'
  31. )->get();
  32. $data =[
  33. 'register_teachers_list'=>$register_teachers_list ,
  34. 'active_teachers_list'=>$active_teachers_list
  35. ];
  36. return view('admin.admin_profile',$data);
  37. }
  38. /**
  39. * Show the form for creating a new resource.
  40. *
  41. * @return \Illuminate\Http\Response
  42. */
  43. public function create()
  44. {
  45. //
  46. }
  47. /**
  48. * Store a newly created resource in storage.
  49. *
  50. * @param \Illuminate\Http\Request $request
  51. * @return \Illuminate\Http\Response
  52. */
  53. public function store(Request $request)
  54. {
  55. //
  56. }
  57. /**
  58. * Display the specified resource.
  59. *
  60. * @param int $id
  61. * @return \Illuminate\Http\Response
  62. */
  63. public function show($id)
  64. {
  65. //
  66. }
  67. /**
  68. * Show the form for editing the specified resource.
  69. *
  70. * @param int $id
  71. * @return \Illuminate\Http\Response
  72. */
  73. public function edit($id)
  74. {
  75. //
  76. }
  77. /**
  78. * Update the specified resource in storage.
  79. *
  80. * @param \Illuminate\Http\Request $request
  81. * @param int $id
  82. * @return \Illuminate\Http\Response
  83. */
  84. public function update(Request $request, $id)
  85. {
  86. //
  87. }
  88. /**
  89. * Remove the specified resource from storage.
  90. *
  91. * @param int $id
  92. * @return \Illuminate\Http\Response
  93. */
  94. public function destroy($id)
  95. {
  96. //
  97. }
  98. }