Teste Sanctum
[Concluído]

Bom dia, Carlos!
Seguindo a aula 9 do módulo 22, o primeiro teste passa...segundo não...
"Expected status code 404 but received 500. Failed asserting that 404 is identical to 500."
Deletei o segundo teste e tentei o terceiro: mesmo erro... Expected status code 404 but received 500. Failed asserting that 404 is identical to 500.
No response->dump(), veio a informação "Call to a member function first() on string"
"C:\laragon\www\foodsmais\app\Http\Controllers\Api\Auth\AuthClientController.php"
Reparei que o segundo colchete estava depois do 404 quando antes de ser feita a mudança com trans... Alguma dica? Ao que me parece, o problema está antes do teste. As rotas estão okay...
return response()->json(['message' => trans('messages.invalid_credentials')], 404);
Olá, tudo bem?
Tem o código no GitHub?
Preciso ver como implementou para conseguir te ajudar a identificar onde errou.
No aguardo.


O seu AuthClientController no método auth está errado.
Como fez:
$client = Client::where('email', $request->email->first());
Como deve ser:
$client = Client::where('email', $request->email)->first();

Mestre é Mestre!!
Não consegui ver isso...
Professor nota 10!
Obrigado!!!

Precisa estar logado para conseguir responder a este ticket!
Clique Aqui Para Entrar!