<?php

namespace App\Http\Responses;

use Laravel\Fortify\Contracts\LoginResponse as LoginResponseContract;

class LoginResponse implements LoginResponseContract
{
    public function toResponse($request)
    {
        $user = $request->user();

        if ($user && $user->role === 'guru') {
            return redirect()->route('teacher.dashboard');
        }

        return redirect()->route('admin.dashboard');
    }
}
