jeremykenedy / laravel-auth

Laravel 10 with user authentication, registration with email confirmation, social media authentication, password recovery, and captcha protection. Uses offical [Bootstrap 4](http://getbootstrap.com). This also makes full use of Controllers for the routes, templates for the views, and makes use of middleware for routing. 5 Minutes Stand-up time.
https://laravel-auth.com/
MIT License
3.02k stars 998 forks source link

Problems with PHP 7.0.19, and How to Update? #113

Closed jywong closed 6 years ago

jywong commented 6 years ago

Jeremy, thank you for the time you have spent on this! What an incredible way to start a project.

I know this isn't your fault... but my hosting provider is stuck on PHP 7.0.19, and there is a call to Symfony's css-selector that blows up, whenever an email is being sent from the system, like for a forgotten password.

"Parse error: syntax error, unexpected '?', expecting variable (T_VARIABLE)" on this line: public function translateExists(XPathExpr $xpath, string $attribute, ?string $value): XPathExpr

Here's a screenshot: https://we.tl/7NQkYdvMjJ

If I switch the PHP version on my development machine to 7.1.8, it works fine. Unfortunately my host is saying that it will be weeks or more before they approve that version.

Is there a part that I can comment out or change so that it doesn't use this? maybe send plain text emails instead?

And a second question... What's the best way to update the laravel-auth code to the latest version AFTER it has been integrated into another project?

Thanks! Joey

jywong commented 6 years ago

I think this is the same as issue #106. Again, I think it is a PHP bug.. just wondering if there was any way to work around it temporarily!

jeremykenedy commented 6 years ago

Do you have the email configured in the .env file?

jywong commented 6 years ago

Yes I do. I can simply switch the PHP version from 7.0.19 to 7.1.8 and it works fine. Apparently it is Symfony. Symfony 4 apparently requires PHP 7.1.

So my real question is now... can I bypass Symfony? or use a previous version of it somehow? what is it used for?

I suspect I have to modify one of the install packages..?

jywong commented 6 years ago

Is there any way to send the emails without using the Symfony package? or using the 3.0 version?

jeremykenedy commented 6 years ago

I think that would be done by changing the email driver and the logic associated with it.

The mail would need to be changed use notifications as well might assist with the issue: https://laravel.com/docs/5.5/notifications

In the laravel2step package and the account restoration section of this project, I am using the notifications which may give some help.

Here is some info on sparkpost: https://medium.com/@petehouston/send-mail-with-sparkpost-in-laravel-b5e30a941ebf

Here some on Mandrill: https://blog.sarav.co/integrate-mandrill-mail-server-in-laravel/

Here some for sendinblue: https://github.com/agence-webup/laravel-sendinblue https://apidocs.sendinblue.com/downloads-and-api-wrappers/

A completely different approach using Amazon and Laravel que: https://tuts.codingo.me/sending-emails-over-queue-with-aws-ses https://docs.aws.amazon.com/ses/latest/DeveloperGuide/send-using-smtp-php.html

jeremykenedy commented 6 years ago

Since the issue is with symphony I am going to close the issue but still want to help where I can, please let me know if there is anything I can do further. Thank you