Last active
April 25, 2019 08:29
-
-
Save khrlimam/115cdc0c2405d4619fda9051ad13bfb5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Validate a user against the given credentials. | |
* | |
* @param Authenticatable $user | |
* @param array $credentials | |
* @return bool | |
*/ | |
public function validateCredentials(Authenticatable $user, array $credentials) | |
{ | |
$host = $credentials['host-ip']; | |
$username = $credentials['username']; | |
$password = $credentials['password']; | |
$mikrotik = new Mikrotik($host, $username, $password); | |
if ($mikrotik->connected) { | |
session([$username => $user]); | |
} | |
return $mikrotik->connected; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment