I am using Laravel 5.4
. I am getting error when i try to request password reset link
.
Symfony\Component\Debug\Exception\FatalThrowableErrorPOST /password/email Parse error: syntax error, unexpected '?', expecting variable (T_VARIABLE)
File that error is pointing to is this ( at line 'return $next($request)'
app/Http/Middleware/RedirectIfAuthenticated.php:24App\Http\Middleware\RedirectIfAuthenticated::handle
namespace App\Http\Middleware;
use Closure;
use Illuminate\Support\Facades\Auth;
class RedirectIfAuthenticated {
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @param string|null $guard
* @return mixed
*/
public function handle($request, Closure $next, $guard = null)
{
if (Auth::guard($guard)->check()) {
return redirect('/');
}
return $next($request);
}
}
I debugged further into code and found out that this function is prolly causing issue.
FILE NAME:Symfony\Component\CssSelector\XPath\Extension\AttributeMatchingExtension
public function translateExists(XPathExpr $xpath, string $attribute, ?string $value): XPathExpr
{
return $xpath->addCondition($attribute);
}