0
我檢查了一些關於這個問題的問題,但仍然無法弄清楚。傳遞多個數據到電子郵件查看laravel 5.3
因此,這裏是我的控制器(我切斷了一些代碼來使問題短期):
public function hour(Request $request)
{
$user = JWTAuth::parseToken()->authenticate();
$user->phone = $request->phone;
$user->city = $request->city;
$user->street = $request->street;
$user->save();
$car = Car::find($request->id);
$car->status = 'yes';
$car->save();
$time = new Reservation();
$time->from_date = $from;
$time->to_date = $to;
$Reservation_id = $time->id;
$time->save();
Mail::to('[email protected]')->send(new NewRequestMail($user,$car,$time));
然後可郵寄:
public $car;
public $user;
public $time;
public function __construct($car,$time,$user)
{
$this->car = $car;
$this->time = $time;
$this->user = $user;
}
現在,當我試圖在電子郵件數據獲取。查看此$car->status
或嘗試獲取有關用戶的更多信息$user->street
我在我的電子郵件中空白!我唯一得到的是$user->name
。有一個更好的方法嗎 ?您的幫助將非常感激