我使用下面的代码发送电子邮件
Mail::send('emails.sample',[],function($message) use($attachment,$filename)
{
$message->subject('PDF is generated !');
$message->from('test@example.com', 'Example');
$message->to('user@gmail.com');
$message->attachData($attachment,$filename,array('mime'=>'application/pdf','Content-Disposition'=>'attachment'));
});
Run Code Online (Sandbox Code Playgroud)
但是收到电子邮件后,发件人电子邮件地址是这样的
test=example.com@mailgun.org 代表示例 test@example.com
但它应该像email address或者name
test@example.com
我该如何解决?任何建议,请!
我试图显示查询中的月份名称,但它不打印。
以下是我的查询:
$stats = DB::table('leadsheet')
->whereYear('created_at', '>=', $days)
->groupBy('month')
->orderBy('month', 'ASC')
->get([
DB::raw('MONTH(created_at) as month'),
DB::raw('COUNT(*) as value')
]);
Run Code Online (Sandbox Code Playgroud)
我的 json 数据如下所示:
[{"month":1,"value":380},{"month":2,"value":2146},{"month":3,"value":2008},{"month":4,"value":1399},{"month":5,"value":1719},{"month":6,"value":4497},{"month":7,"value":911},{"month":8,"value":495},{"month":9,"value":691},{"month":10,"value":370},{"month":11,"value":479}]
Run Code Online (Sandbox Code Playgroud)
在这个结果中,我只想将数字 1 显示为一月,2 显示为二月,依此类推。但我试图给出未发生的月份的格式。
所需的输入如下:
{"month":Jan,"value":380}...
Run Code Online (Sandbox Code Playgroud)
有人可以帮我吗?
我正在尝试在 Laravel 中使用 ajax 方法下载一个 excel 文件。控制器功能:
$myFile = Excel::create($name, function ($excel) use ($export) {
$excel->sheet('Data', function ($sheet) use ($export) {
$sheet->fromArray($export);
$sheet->cells('A1:N1', function ($cells) {
$cells->setBackground('#dbdbdb');
$cells->setFontColor('#000000');
$cells->setFontWeight('bold');
$cells->setFont(array(
'family' => 'Calibri',
'size' => '9',
));
});
$sheet->setStyle(array(
'font' => array(
'name' => 'Calibri',
'size' => 9,
),
));
});
});
$myFile = $myFile->string('xlsx');
$response = array(
'name' => $name,
'file' => "data:application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;base64," . base64_encode($myFile),
);
return response()->json($response);
Run Code Online (Sandbox Code Playgroud)
阿贾克斯功能:
$(document).on('click', '.ExportJobs', function() {
$.ajaxSetup({
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
} …Run Code Online (Sandbox Code Playgroud)