我想在laravel邮件函数中获取数组值。我将数据值作为$data['users'] =$users;
并传递到邮件函数,如下所示,并在视图页面中获取,如下所示。我想获取request_id与邮件功能
$data['users'] =$users;
Mail::Send('email.welcome', $data, function($message) use ($data) {
$id=$data->request_id //want to get here
}
welcome.blade.php
@foreach ($users as $user)
<td>{{$user->request_id}}</td>
@endforeach
完成
$id = $data['users'][0]->req_id;