public function events() { return Event::withYear($this->year)->withMonth($this->month)->orderBy('scheduled_at', 'ASC')->get(); }
public function export($year = null, $month = null) { if (!$year) { $year = Carbon::now()->addMonth()->year; } if (!$month) { $month = Carbon::now()->addMonth()->month; } $events = Event::withYear($year)->withMonth($month)->orderBy('scheduled_at', 'ASC')->get(); $pdf = App::make('dompdf.wrapper'); $pdf->loadView('events.export', compact('events', 'year', 'month')); return $pdf->stream(); //return $pdf->download('kellerperle_'.$year.'-'.$month.'.pdf'); }