本文整理匯總了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;
}