for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Yajra\Oci8\Auth;
use Illuminate\Auth\EloquentUserProvider;
use Illuminate\Support\Str;
class OracleUserProvider extends EloquentUserProvider
{
/**
* 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;
}
// First we will add each credential element to the query as a where clause.
// Then we can execute the query and, if we found a user, return it in a
// Eloquent User "model" that will be utilized by the Guard instances.
$query = $this->createModel()->newQuery();
foreach ($credentials as $key => $value) {
if (! Str::contains($key, 'password')) {
$query->whereRaw("upper({$key}) = upper(?)", [$value]);
return $query->first();