24 lines
637 B
PHP
24 lines
637 B
PHP
<?php
|
|
|
|
namespace App\Http\Responses;
|
|
|
|
use Illuminate\Http\JsonResponse;
|
|
use Laravel\Fortify\Contracts\FailedPasswordResetResponse as FailedPasswordResetResponseContract;
|
|
|
|
class ResetPasswordFailedResponse implements FailedPasswordResetResponseContract
|
|
{
|
|
/**
|
|
* Create an HTTP response that represents the object.
|
|
*/
|
|
public function toResponse($request): JsonResponse
|
|
{
|
|
$message = __('The provided password reset token is invalid.');
|
|
|
|
return response()->json([
|
|
'message' => $message,
|
|
'errors' => [
|
|
'email' => [$message],
|
|
],
|
|
], 422);
|
|
}
|
|
}
|