これは当てはまりません。 Laravelはresolve the token in several ways firstときattempting to resolve an instance of the userそのメソッドが呼び出される
* Get the token for the current request.
*
* @return string
*/
public function getTokenForRequest()
{
$token = $this->request->query($this->inputKey);
if (empty($token)) {
$token = $this->request->input($this->inputKey);
}
if (empty($token)) {
$token = $this->request->bearerToken();
}
if (empty($token)) {
$token = $this->request->getPassword();
}
return $token;
}
にしようとします。
/**
* Get the currently authenticated user.
*
* @return \Illuminate\Contracts\Auth\Authenticatable|null
*/
public function user()
{
// If we've already retrieved the user for the current request we can just
// return it back immediately. We do not want to fetch the user data on
// every call to this method because that would be tremendously slow.
if (! is_null($this->user)) {
return $this->user;
}
$user = null;
$token = $this->getTokenForRequest();
if (! empty($token)) {
$user = $this->provider->retrieveByCredentials(
[$this->storageKey => $token]
);
}
return $this->user = $user;
}
そしてprovider
この場合には、いや、方法retrieveByCredentials
performs a strict case-sensitive checkデータベース・工場->where()
方法を使用してDatabaseUserProvider
、あるのように、ここに表示されます:
public function retrieveByCredentials(array $credentials)
{
// 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
// generic "user" object that will be utilized by the Guard instances.
$query = $this->conn->table($this->table);
foreach ($credentials as $key => $value) {
if (! Str::contains($key, 'password')) {
$query->where($key, $value);
}
}
// Now we are ready to execute the query to see if we have an user matching
// the given credentials. If not, we will just return nulls and indicate
// that there are no matching users for these given credential arrays.
$user = $query->first();
return $this->getGenericUser($user);
}
あなたのケースは典型的ではありません。ここには私たちが関与していない他のコンポーネントがあります。
よろしくお願いします。しかし、私が言ったように私は新鮮なlaravelのインストールで開発しています。私のdev-macであることを除いて特別なことはありません。 迷惑メールのインストールで自分のスクリプトをチェックして、自分のmacが根本的な問題であるかどうかを確認します。 ご回答ありがとうございます。 –