I have just switch to new version of laravel i.e. 5.3 for my new project.
Once I need to send registration mail to my portal customer, where registration mail contains account activation link where this mail is sent using Mail::queue.
I am generating that link using url("activate/$random_string");
and which always prints http://localhost/activate/$random_string_value
but what i wants is,
http://localhost/project/public/activate/$random_string_value
or
http://192.168.0.45/laravel/public/activate/$random_string_value
(above result i am getting till laravel 5.2)
i have set APP_URL value in .env as well and in config/app.php as well,
I have tried php artisan config:clear and php artisan config:cache
Can anybody help me to sort out this issue. I have one possible solution is to use env('APP_URL') to genrate same url.
I think your url need to update like:
url("activate/".$random_string);
Hope this work for you!
Related
I am trying to edit Laravel default email verification message.
I have tried publishing the notification and mail resources.
php artisan vendor:publish --tag=laravel-notifications
php artisan vendor:publish --tag=laravel-mail
New folders called mail and notification were created in resource>views>vendor but I haven't been able to find the file which holds the codes for the message in either of the folders. I found a file that seems like the one in vendor>laravel>framework>src>Illuminate>Auth>Notification which is called VerifyEmail but I'm not sure if I'm suppose to change this file since I couldn't find any article online talking about this file.
My Laravel version is 7.15.0.
Any help would be appreciated as I have tried multiple methods with no success.
Thank you in advance.
I am trying to send email to user for forget password using rest API,
here is my controller:
enter image description here
strong text
put when I call this forget function by my Api on postman it gives this error :
'laravel.password_resets' doesn't exist
how can I solve this issue
Please run
php artisan migrate
There is a possibility that your would have dropped the database table.
Php artisan migrate: fresh
I have a problem with Laravel 5.7.22, I tried to activate the verification with the email and I get the message that:
A fresh verification link has been sent to your email address.
how it's properly working at least the part that send the emails with the verification link but when I click the generated link I get the following page:
I have tried to erase the project and reinstall it, and I also tried to generate the signature key with this command:
php artisan key:generate
that I have found in this other question, but that didn't work, I don't know what could be causing this issue.
I also tried to debug the the function hasValidSignature in the file UrlGenerator from Laravel, just because I read that it could help, but it doesn't make sense, I haven't event altered the middleware or something I'm just with the laravel routes that it generates by default.
The generated link looks something like this.
https://www.example.com/email/verify/1?expires=1548527438&signature=daebab97afbb2da6a0f37615bc3db7e59db9c59e704d185addcf88adf46e8f6d
I also have configured my .env file properly and the files under the config folder just for security.
I followed Laravels docs (link) about Email verification. Everything seems to work except for a 403 - invalid signature. This errors shows when clicking on the email link. I'm using shared hosting.
Url is similar to this:
[..]email/verify/21?expires=154270[..]&signature=920dcb9ac2fbf5[..]
would appreciate all the help I could get! Thanks!
Here is the answer: https://stackoverflow.com/a/44839664
You have to generate a key: php artisan key:generate
I made a basic project in Laravel 5.4 using PhpStorm and executed php artisan make:auth and php artisan migrate. After running php artisan serve, I accessed the resulting site on http://localhost:8000 and tested the password recovery. Using Gmail for SMTP, the corresponding user received an e-mail with a link like this:
http://localhost/password/reset/d55b8591a690c96742e192d31ba6b1c7b06cb4b390fa08baaf02ce261618b884
It redirects me to a 404 Error page.
Looking at php artisan route:list, there is a route called "password.reset", set on GET|HEAD with the following URI: password/reset/{token}. So it seams that should work, since there is a place for a token. The action is: App\Http\Controllers\Auth\ResetPasswordController#showResetForm
There's basically nothing on that controller, but it has use ResetsPassword from Illuminate\Foundation\Auth inside the class. When I try to overwrite the function, I look at the original and it does redirect to reset password view.
But something is not working. I tried to add :8000 to the link, but it just redirects me to a blank page and I'm sure the server is still serving at that port. What am I doing wrong?
You have to change APP_URL=http://localhost to APP_URL=http://localhost:8000 in the .env
Your route in the email must have the ":8000" that is the port of your application. Your browser if looking for the same route but in just in the localhost route without a port