本文整理汇总了PHP中Jenssegers\Date\Date::today方法的典型用法代码示例。如果您正苦于以下问题:PHP Date::today方法的具体用法?PHP Date::today怎么用?PHP Date::today使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Jenssegers\Date\Date
的用法示例。
在下文中一共展示了Date::today方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: exportLaporan
public function exportLaporan(Request $request)
{
$input = $request->all();
$orders = \DB::table('order')->get();
$headers = ['Nama', 'Alamat', 'Telepon', 'Pewangi', 'Pengerjaan', 'Berat', 'Total bayar', 'Status', 'Lunas'];
$tanggal = Date::today();
if (Input::get('pdf')) {
$pdf = \PDF::loadView('print.layout', compact('headers', 'orders', 'tanggal'))->setPaper('a4')->setOrientation('landscape');
return $pdf->stream();
} elseif (Input::get('excel')) {
$data = compact('headers', 'orders', 'tanggal');
$title = 'Order_' . $data['tanggal'];
return Excel::create($title, function ($excel) use($data) {
$excel->setTitle('Laporan Order Go-Laundry');
$excel->setCreator('Admin')->setCompany('Go-Laundry');
$excel->sheet('Laporan Order', function ($sheet) use($data) {
$sheet->loadView('print.table', $data);
$sheet->setAutoSize(true);
});
})->export('xlsx');
}
}
示例2: LastMatch
/**
* Get game info from last match for display in first page
* @return \Illuminate\Database\Eloquent\Model|null|static
*/
public function LastMatch()
{
$match = FootballMatches::whereIn('status', ['FT', 'AET'])->whereDate('formatted_date', '<=', Date::today()->format('Y-m-d'))->orderBy('formatted_date', 'desc')->first();
return $match;
}