I just start to learning laravel and now I have a problem with mail settings.
I want to send reset password email to the log file of the project and for this I change the .env file settings from MAIL_DRIVER = smtp to MAIL_DRIVER = log
I also change the mail.php settings and reset my server because I use (php artisan serve) command.
still i receive following error
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'mytodo.password_resets' doesn't exist (SQL: delete from password_resets where email = Ali#gmail.com
I don't know why it is search for table.
I also see the following question it has same problem but my problem doesn't solve by their instruction.
Laravel Mail to Log
please help me is there anything else i should try.
A table must be created to store the password reset tokens and There is our processes :
Get reset request
Generate token
Store token in DB
Send email
In your way, you only change step 4. You need store tokens and you should have a password_resets table in your database.
Related
I'm having a problem with laravel nine password recovery with jetstream/fortify.
I have pulled it to a modal, but I keep pointing to the URL route('password.email') with the post method.
But I get this error, attached image:
Error Class "Ramsey\Uuid\Converter\Time\UnixTimeConverter" not
found
I have checked that I have "ramsey/uuid": "^4.5".
In the database, I see that password_resets changes the token.
I am at a loss as to what the error could be.
Recover passwords in Laravel 9 by using a form and sending an email with a link to create a new password.
At the moment I'm trying to implement the Laravel 5.7 email verification. I have got it so a mail driver will send an email out when registering a user. However, when I click on the email verify button, I get a 404 error.
The URL it sends me is this:
http://localhost/email/verify/16?expires=1543926629&signature=fa3a2a0d90c5752f99b24a7cf7c789edadba5aad2922fff907c289b3364ebceb
However, it is using the wrong URL as the local APP_URL in the regular .env is not localhost. Does anyone know how I can tell the email verification to use APP_URL instead of localhost? When I rename the URL to the correct URL, I can complete the email verification. Thanks.
Verify in your Http\Controllers\Auth\VerificationController.php if the protected attribute $redirectTo value exist in your routes\web.php or can be handled.
Got laravel's password reset setuped correctly and working, now whats left is how to verify if the reset token exists in the password_resets table and proceed if valid. At the moment if I type in my url example.com/password/reset/somestuff it redirects me to the page where it asks for email and password, so there's no security :)
Thanks and I hope you understood my question.
You can use the laravel query builder to make this check. For example:
if(DB::table('table_name')
->where('user', $user)
->whereNotNull('token')
->exists()){
do something
}
https://laravel.com/docs/5.6/queries
I am using sqlite as my default database driver.
I already connected the database using .env and also seeded some data using tinker.
N.B: Data is inserted correctly in my database. Database name is
database.sqlite
But when I try to login using email and password created with tinker it shows the following error.
"SQLSTATE[HY000] [1045] Access denied for user 'homestead'#'localhost' (using password: YES) (SQL: select * from `users` where `email` = ryleigh12#example.net limit 1)
here is the image showing that error
If you are using the PHP's default web server (php artisan serve) you need to restart your server after any change in your .env file.
So I currently have setup my laravel project in C-panel, and have updated the .env file to have the appropriate email address. When I, for instance, use the make:auth reset password feature it responds with the appropriate "We have e-mailed your password reset link!", but there is no mail sent.
I am not sure how to test this to find the hole in the problem. When I used mailtrap I was able to send and receive emails no problem, but there is some issue with the webmail in c-panel not processing and sending out an email from Laravel 5.4
Help please
change your .env file. set MAIL_DRIVER=mail it will start working. make sure you set from in mail.php
`