mirror of
https://github.com/HolgerHatGarKeineNode/einundzwanzig-app.git
synced 2026-01-24 12:03:17 +00:00
🗓️ 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:
30
database/factories/MeetupEventFactory.php
Normal file
30
database/factories/MeetupEventFactory.php
Normal 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(),
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user