Compare commits

..

23 Commits
master ... 0.6

Author SHA1 Message Date
Dariusz Jaski 83f328d8ff 0.6 2021-03-17 22:45:55 +01:00
Michal Sieciechowicz f7d8f76a79 Merge remote-tracking branch 'origin/0.4' into 0.5 2021-03-17 13:44:51 +01:00
Michal Sieciechowicz 766c29c5f3 laravel user provider 2021-03-17 13:08:20 +01:00
Dariusz Jaski e14198e262 fix 2021-03-08 22:26:12 +01:00
Dariusz Jaski 1be8bc5511 fix 2021-03-08 20:55:47 +01:00
Dariusz Jaski 37599e8cf6 fix 2021-03-07 11:34:29 +01:00
Dariusz Jaski fbf2aaae07 0.2.3 2021-03-07 11:30:13 +01:00
Dariusz Jaski 1920374639 ns 2021-03-07 11:20:52 +01:00
Dariusz Jaski 1c886fb385 model 2021-03-07 11:17:21 +01:00
Dariusz Jaski b9d1d1601a d 2021-03-07 11:12:43 +01:00
Dariusz Jaski 3f9758c403 fdn 2021-03-07 11:06:39 +01:00
Dariusz Jaski 661406db67 nullsafe 2021-03-07 10:55:23 +01:00
Dariusz Jaski 9c6c34f870 eq 2021-03-07 10:54:11 +01:00
Dariusz Jaski a026facb7c iface 2021-03-07 09:55:06 +01:00
Dariusz Jaski 3c43612503 rename 2021-03-07 09:52:45 +01:00
Dariusz Jaski d32c7a0b92 use 2021-03-07 09:39:13 +01:00
Dariusz Jaski d9da5559c5 NS 2021-03-07 01:53:29 +01:00
Dariusz Jaski afc2b5a261 rename 2021-03-07 01:49:33 +01:00
Dariusz Jaski 54113fffc0 connectors 2021-03-07 01:15:16 +01:00
Michal Sieciechowicz 9204f70e50 0.2.2 2021-03-03 13:41:02 +01:00
Michal Sieciechowicz a3d8bb6131 fixes 2021-03-01 16:25:31 +01:00
Michal Sieciechowicz a3d71c7bc5 fix 2021-03-01 16:22:54 +01:00
Michal Sieciechowicz a3c38a27c7 fixes 2021-03-01 16:06:02 +01:00
2 changed files with 65 additions and 1 deletions

View File

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

View File

@ -0,0 +1,64 @@
<?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) {
}
}