Support the ongoing development of Laravel.io →
posted 6 years ago
Mail
Last updated 1 year ago.
0

Warning: $message could conflict with a reserved variable name, what's the purpose of your "$message" variable?

if you need to pass data you better use with() method (https://laravel.com/api/5.4/Illuminate/Mail/Mailable.html#method_with)

Anyway make it public and it will be available in the scope of building message (https://laravel.com/docs/5.4/mail#view-data)

ie:

public $message;

but you still need to populate the variable... you can do it in the construct

ie:

public function __construct(Request $request, String $message) { $this->request = $request; $this->message = $message; }

Last updated 6 years ago.
0

replace your $massage variable by $msg and it will work.Pass this variable to your construct as a parametere and then define a public attribute like so public $msg

krishnaguragain liked this reply

1

Sign in to participate in this thread!

Eventy

Your banner here too?

Daniel Brower Daniel Brower dbrower256 Joined 22 Jun 2017

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.