Skip to content

Instantly share code, notes, and snippets.

@khrlimam
Last active April 25, 2019 08:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save khrlimam/115cdc0c2405d4619fda9051ad13bfb5 to your computer and use it in GitHub Desktop.
Save khrlimam/115cdc0c2405d4619fda9051ad13bfb5 to your computer and use it in GitHub Desktop.
<?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