mirror of
https://github.com/HolgerHatGarKeineNode/einundzwanzig-nostr.git
synced 2026-05-20 10:04:53 +00:00
cb61d9d543
🎨 Refactor `Lecturer` model to include new fields and factory usage 🔧 Update `DatabaseSeeder` to handle default seeds 🛠️ Enhance `einundzwanzig` database configuration for SQLite compatibility
48 lines
1.3 KiB
PHP
48 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace Database\Factories;
|
|
|
|
use App\Models\Meetup;
|
|
use App\Models\MeetupEvent;
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
|
|
/**
|
|
* @extends Factory<MeetupEvent>
|
|
*/
|
|
class MeetupEventFactory extends Factory
|
|
{
|
|
/**
|
|
* @return array<string, mixed>
|
|
*/
|
|
public function definition(): array
|
|
{
|
|
return [
|
|
'meetup_id' => Meetup::factory(),
|
|
'start' => fake()->dateTimeBetween('+1 day', '+90 days'),
|
|
'location' => fake()->company().', '.fake()->streetAddress(),
|
|
'description' => fake()->paragraph(),
|
|
'link' => fake()->url(),
|
|
'attendees' => [
|
|
'f240be2b684f85cc81566f2081386af81d7427ea86250c8bde6b7a8500c761ba',
|
|
bin2hex(random_bytes(32)),
|
|
],
|
|
'might_attendees' => [bin2hex(random_bytes(32))],
|
|
'nostr_status' => 'Sent event '.bin2hex(random_bytes(8)).' to wss://simple-relay.codingarena.top',
|
|
];
|
|
}
|
|
|
|
public function past(): static
|
|
{
|
|
return $this->state(fn () => [
|
|
'start' => fake()->dateTimeBetween('-90 days', '-1 day'),
|
|
]);
|
|
}
|
|
|
|
public function upcoming(): static
|
|
{
|
|
return $this->state(fn () => [
|
|
'start' => fake()->dateTimeBetween('+1 day', '+30 days'),
|
|
]);
|
|
}
|
|
}
|