Search code examples
phplaravelsmtpreset-password

Laravel 5 : Parse error: syntax error, unexpected '?', expecting variable (T_VARIABLE)


On my Local server everything was good was using mailtrap mail server as smtp server. but when my website is on live server and when I trying to reset password (forgot password ) getting following error screenshot is attached.I am using hostgators cpanels inbuilt smtp. any more details I will provide if needed.enter image description here


Solution

  • You need to install PHP version 7.1 because nullable types were introduced in 7.1:

    ?string $value
    

    And from the Laravel docs:

    You will need to make sure your server meets the following requirements:

    PHP >= 7.1.3