Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/228.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/laravel/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 尝试在laravel中发送重置密码链接时出现解析错误_Php_Laravel_Symfony - Fatal编程技术网

Php 尝试在laravel中发送重置密码链接时出现解析错误

Php 尝试在laravel中发送重置密码链接时出现解析错误,php,laravel,symfony,Php,Laravel,Symfony,我使用的是Laravel 5.4。我试图请求密码重置链接时出错 Symfony\Component\Debug\Exception\FatalThrowableErrorPOST /密码/电子邮件分析错误:语法错误,意外的“?”,应为 变量T_变量 错误指向的文件位于“return$next$request”行 app/Http/Middleware/RedirectIfAuthenticated.php:24App\Http\Middleware\RedirectIfAuthenticated

我使用的是Laravel 5.4。我试图请求密码重置链接时出错

Symfony\Component\Debug\Exception\FatalThrowableErrorPOST /密码/电子邮件分析错误:语法错误,意外的“?”,应为 变量T_变量

错误指向的文件位于“return$next$request”行

app/Http/Middleware/RedirectIfAuthenticated.php:24App\Http\Middleware\RedirectIfAuthenticated::handle

我进一步调试了代码,发现这个函数很容易导致问题。 文件名:Symfony\Component\CssSelector\XPath\Extension\AttributeMatchingExtension

public function translateExists(XPathExpr $xpath, string $attribute, ?string $value): XPathExpr
{
    return $xpath->addCondition($attribute);
}
我在使用php邮件功能时遇到了与php 7.0.23和Laravel 5.5相同的问题:

分析错误:语法错误,意外的“?”,应在[…]/vendor/symfony/css selector/XPath/Extension/attributeMachingextension.php处使用变量T_variable:46


通过升级到PHP7.1版本,问题得以解决。它也适用于PHP7.2

下一步是什么?和$request$next似乎是一个变量,但您将其视为一个函数。您能告诉我们您的重置密码和控制器代码的电子邮件视图吗?如果用户不是来宾,它的laravel默认中间件用于重定向请求。它缺少extends中间件。@Sohel0415,我使用默认laravel用户登录和密码重置机制,我尝试调试代码,请求从中间件重定向。我尝试在这个方法App\Http\Controllers\Auth中调试\ResetPasswordController@reset这也解决了我的问题,将php7.0升级到php7.1*
public function translateExists(XPathExpr $xpath, string $attribute, ?string $value): XPathExpr
{
    return $xpath->addCondition($attribute);
}