Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace App\Http\Controllers\Auth;
- use App\Http\Controllers\Controller;
- use Illuminate\Foundation\Auth\AuthenticatesUsers;
- class LoginController extends Controller
- {
- /*
- |--------------------------------------------------------------------------
- | Login Controller
- |--------------------------------------------------------------------------
- |
- | This controller handles authenticating users for the application and
- | redirecting them to your home screen. The controller uses a trait
- | to conveniently provide its functionality to your applications.
- |
- */
- use AuthenticatesUsers;
- /**
- * Where to redirect users after login.
- *
- * @var string
- */
- protected $redirectTo = '/';
- protected function redirectTo()
- {
- if ((auth()->user()->department == 'Digital Marketing') || (auth()->user()->department == 'digital marketing') || (auth()->user()->department == 'DIGITAL MARKETING')) {
- return '/custom';
- }
- elseif ((auth()->user()->department == 'Analytics') || (auth()->user()->department == 'analytics') || (auth()->user()->department == 'ANALYTICS')) {
- return '/documentation_analytics';
- }
- else return '/';
- }
- /**
- * Create a new controller instance.
- *
- * @return void
- */
- public function __construct()
- {
- $this->middleware('guest')->except('/');
- }
- }
Add Comment
Please, Sign In to add comment