wansyahi1

Javascript

Dec 25th, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.47 KB | None | 0 0
  1. <?php
  2.  
  3. namespace App\Http\Controllers\Auth;
  4.  
  5. use App\Http\Controllers\Controller;
  6. use Illuminate\Foundation\Auth\AuthenticatesUsers;
  7.  
  8. class LoginController extends Controller
  9. {
  10. /*
  11. |--------------------------------------------------------------------------
  12. | Login Controller
  13. |--------------------------------------------------------------------------
  14. |
  15. | This controller handles authenticating users for the application and
  16. | redirecting them to your home screen. The controller uses a trait
  17. | to conveniently provide its functionality to your applications.
  18. |
  19. */
  20.  
  21. use AuthenticatesUsers;
  22.  
  23. /**
  24. * Where to redirect users after login.
  25. *
  26. * @var string
  27. */
  28. protected $redirectTo = '/';
  29.  
  30. protected function redirectTo()
  31. {
  32. if ((auth()->user()->department == 'Digital Marketing') || (auth()->user()->department == 'digital marketing') || (auth()->user()->department == 'DIGITAL MARKETING')) {
  33. return '/custom';
  34.  
  35. }
  36. elseif ((auth()->user()->department == 'Analytics') || (auth()->user()->department == 'analytics') || (auth()->user()->department == 'ANALYTICS')) {
  37. return '/documentation_analytics';
  38. }
  39. else return '/';
  40. }
  41.  
  42. /**
  43. * Create a new controller instance.
  44. *
  45. * @return void
  46. */
  47. public function __construct()
  48. {
  49. $this->middleware('guest')->except('/');
  50. }
  51.  
  52.  
  53. }
Add Comment
Please, Sign In to add comment