HomeController.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. namespace App\Http\Controllers;
  3. use Illuminate\Http\Request;
  4. use App\User;
  5. use App\Models\Department;
  6. use App\Models\University;
  7. use Auth;
  8. class HomeController extends Controller
  9. {
  10. /**
  11. * Create a new controller instance.
  12. *
  13. * @return void
  14. */
  15. public function __construct()
  16. {
  17. // $this->middleware('auth');
  18. }
  19. public function student_q_form($hash)
  20. {
  21. $hashids=new \Hashids\Hashids('student_q_signup', 25);
  22. $hash_teacher_ids=$hashids->decode($hash);
  23. $user =User::find($hash_teacher_ids[0]);
  24. if(empty($hash_teacher_ids[0])) abort(404);
  25. return view('Q_apply_form',compact('hash_teacher_ids','user'));
  26. }
  27. public function q_apply_register_form($hash)
  28. {
  29. $hashids=new \Hashids\Hashids('student_wishlist_signup', 25);
  30. $hash_student_ids=$hashids->decode($hash);
  31. if(empty($hash_student_ids[0])) abort(404);
  32. $user =User::find($hash_student_ids[0]);
  33. return view('auth.q_apply_register_form',compact('hash_student_ids','user'));
  34. }
  35. public function invited_register_form($hash)
  36. {
  37. $hashids=new \Hashids\Hashids('teacher_invitation_signup', 25);
  38. $hash_ids=$hashids->decode($hash);
  39. if(empty($hash_ids[0])) abort(404);
  40. $user =User::find($hash_ids[0]);
  41. $departments =Department::where('status',1)->orderBy('name','ASC')->get();
  42. $universities =University::orderBy('name','ASC')->get();
  43. return view('auth.invited_register_form',compact('hash_ids','user','departments','universities'));
  44. }
  45. }