Skip to main content

"Black Friday" Discount! Only until December 1st: 50% off all membership plans!

Read more here

christophrumpel/larastreamers

236 stars
1 code files
View christophrumpel/larastreamers on GitHub

app/Http/Controllers/CalendarController.php

Open in GitHub
use App\Models\Stream;
 
class CalendarController extends Controller
{
public function __invoke(Request $request): Response
{
//
Stream::query()
->notOlderThanAYear()
->each(fn(Stream $stream) => $calendar->event(
$stream->toCalendarItem()
));
//
}
}