使用Laravel 5

时间:2015-11-19 19:05:47

标签: php laravel-5

我在控制器中创建了以下数组:

$appointmentLocation = compact("address1", "address2");

return view('appointments.show')->with(['appointmentLocation' => $appointmentLocation]);

我想在我的视图中使用刀片显示它:

{{ $appointmentLocation->address1 }}

但我明白了:Trying to get property of non-object

当我dd($appointmentLocation);

我得到了

array:2 [▼
"address1" => "101 York st."
"address2" => "Suite 1"
]

你知道缺少什么吗?所以我可以使用{{ $appointmentLocation->address1 }}显示?

0 个答案:

没有答案