Compare commits

..

1 Commits
0.6 ... master

Author SHA1 Message Date
Michał Sieciechowicz 248006a830 PR2: 0.2.3
Co-Authored-By: Sieciech <sieciech@noreply.fufle.net>
Co-Committed-By: Sieciech <sieciech@noreply.fufle.net>
2021-03-08 10:28:32 +00:00
2 changed files with 1 additions and 65 deletions

View File

@ -23,7 +23,7 @@ abstract class Model {
}
protected static function QueryModel() {
if (true || (self::$query === null && self::class !== static::class)) {
if (self::$query === null && self::class !== static::class) {
self::$query = static::SetQueryModel();
}
return self::$query;

View File

@ -1,64 +0,0 @@
<?php
namespace Fufle\ORM\Providers;
use Fufle\ORM\Model;
use Illuminate\Support\Str;
use Illuminate\Contracts\Auth\UserProvider;
use Illuminate\Contracts\Auth\Authenticatable;
class PassportUserProvider implements UserProvider {
/**
* The ORM User Model
*/
private $model;
/**
* Create a new ORM user provider.
*
* @return \Illuminate\Contracts\Auth\Authenticatable|null
* @return void
*/
public function __construct(Model $userModel) {
$this->model = $userModel;
}
/**
* Retrieve a user by the given credentials.
*
* @param array $credentials
* @return \Illuminate\Contracts\Auth\Authenticatable|null
*/
public function retrieveByCredentials(array $credentials) {
if (empty($credentials)) {
return;
}
$user = $this->model->findForPassport($credentials['username']);
return $user;
}
/**
* Validate a user against the given credentials.
*
* @param \Illuminate\Contracts\Auth\Authenticatable $user
* @param array $credentials Request credentials
* @return bool
*/
public function validateCredentials(Authenticatable $user, Array $credentials) {
return ($credentials['username'] == $user->getAuthIdentifier() &&
md5($credentials['password']) == $user->getAuthPassword());
}
public function retrieveById($identifier) {
$userClass = get_class($this->model);
return $userClass::FindOrFail($identifier);
}
public function retrieveByToken($identifier, $token) {
}
public function updateRememberToken(Authenticatable $user, $token) {
}
}