I have condition in Controller with checks the value in database and based on this value is redirecting user to different login pages
public function getLogin()
{
$login = DB::table('login')->pluck('login');
//var_dump($login);
if ($login == 1) {
return View::make('users.login');
} else {
return View::make('users.login1');
}
}
When I go to login page I've got this error
Object of class Illuminate\Support\Collection could not be converted to int
When I var_dump($login);
I get
object(Illuminate\Support\Collection)#304 (1) { ["items":protected]=> array(1) { [0]=> int(1) } }
How can I fix this error?