我尝试使用我的电子邮件附加excel文件,但是我收到错误:basename()期望参数1是一个字符串。我做错了什么?非常感谢提前!!!!
这是我的邮件类:
public function build()
{
$licencies = Licencies::where('lb_assurance' , '=' , 'Lafont')->where('created_at' , Carbon::today())->get();
$excel_file = Excel::create('DailyRecapLicencesLafont', function($excel) use ($licencies) {
$excel->sheet('Excel', function($sheet) use ($licencies) {
$sheet->fromArray($licencies);
});
});
return $this->markdown('email.licences.lafont')->attach($excel_file , 'excel.xls');
}
答案 0 :(得分:2)
试试这个:
* @Route("")
*/
public function listAction(Request $request)
{
$list = $this->createList($this->getListObject());
$list->handleRequest($request)->process();
$list->setTemplatesScope($this->getTemplatesScope() . ':Listing\\');
if ($request->isXmlHttpRequest()) {
return new JsonResponse($list->getInfo());
} else {
return $this->render($this->getTemplatesScope().':list.html.twig', $list->render());
}
}