I am using a blade file called email-verification.blade.php to send laravel emails and when i run this file the following errors comes on the browser
htmlspecialchars() expects parameter 1 to be string, object given
I am not getting any solution please provide me the solution.
Answer
It’s looking that you are using wrong syntax under the blade file if you are using an array and you want to use the value of that array under your email blade file. You can use the following syntax for that.
Controller File
$data=['name'=>$request->name,'token'=>$users->remember_token];
E-mail Blade file
<!DOCTYPE html> <html lang="en"> <head> </head> <body> <b>Hi {{$name}},</b> <p>Please verify your email id by <a href="{{asset('')}}email-verification/{{$token}}">clicking here</a></p> <b>Thank You !</b> </body> </html>
Ravindra is a passionate full stack developer and dedicated blogger with a flair for crafting user-friendly web applications and insightful articles. With expertise spanning front-end and back-end technologies, Ravindra brings ideas to life through innovative coding solutions.