Example #1
0
 public function events()
 {
     return Event::withYear($this->year)->withMonth($this->month)->orderBy('scheduled_at', 'ASC')->get();
 }
Example #2
0
 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');
 }