Skip to content

Commit

Permalink
be smarter
Browse files Browse the repository at this point in the history
  • Loading branch information
edalzell committed May 1, 2024
1 parent 42ea932 commit 204bc89
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Http/Controllers/IcsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class IcsController extends Controller

public function __invoke(Request $request)
{
$handle = $request->get('collection', config('events.collection'));
$handle = $request->get('collection', config('events.collection', 'events'));
$date = $request->has('date') ? CarbonImmutable::parse($request->get('date')) : null;
$eventId = $request->get('event');
$entry = null;
Expand Down
4 changes: 2 additions & 2 deletions src/Tags/Events.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function downloadLink(): string
return route(
'statamic.events.ics.show',
Arr::removeNullValues([
'collection' => $this->params->get('collection', config('events.collection')),
'collection' => $this->params->get('collection', config('events.collection', 'events')),
'date' => $this->params->has('date') ? Carbon::parse($this->params->get('date'))->toDateString() : null,
'event' => $this->params->get('event'),
])
Expand Down Expand Up @@ -129,7 +129,7 @@ private function generator(): Generator
{
$generator = $this->params->has('event') ?
Generator::fromEntry($this->params->get('event')) :
Generator::fromCollection($this->params->get('collection', config('events.collection')));
Generator::fromCollection($this->params->get('collection', config('events.collection', 'events')));

return $generator
->site($this->params->get('site'))
Expand Down

0 comments on commit 204bc89

Please sign in to comment.