🗓️ Add MeetupEventFactory, implement rate limiting for calendar downloads, and enhance test coverage

- **Added:** `MeetupEventFactory` for generating test data.
- **Implemented:** Rate limiting (`throttle:calendar`) for `stream-calendar` routes to prevent abuse.
- **Enhanced:** `DownloadMeetupCalendar` controller with validation and cleaner query structure.
- **Added:** Feature tests for calendar downloading, invalid input handling, and rate limiting.
This commit is contained in:
HolgerHatGarKeineNode
2026-01-17 21:18:55 +01:00
parent d3acc365fd
commit da1324adda
5 changed files with 140 additions and 24 deletions

View File

@@ -0,0 +1,30 @@
<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\MeetupEvent>
*/
class MeetupEventFactory extends Factory
{
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
return [
'meetup_id' => \App\Models\Meetup::factory(),
'start' => now()->addWeek(),
'location' => fake()->address(),
'description' => fake()->paragraph(),
'link' => fake()->url(),
'attendees' => [],
'might_attendees' => [],
'created_by' => \App\Models\User::factory(),
];
}
}