mirror of
https://github.com/HolgerHatGarKeineNode/einundzwanzig-app.git
synced 2026-01-24 12:03:17 +00:00
🔥 Remove unused tests, update factories, and introduce recurrence features
- **Removed:** Unused feature and component tests to clean up the codebase. - **Added:** `RecurrenceType` enum for handling event recurrence modes. - **Introduced:** City, Country, and Meetup factories for test data generation. - **Implemented:** Migration to support recurring event fields in `meetup_events` table. - **Enhanced:** Livewire meetup events creation with recurrence validation and preview logic. - **Updated:** PHPUnit test suite configuration and composer dependencies for `pestphp/pest@v4.3`. - **Refined:** SEO configuration (`favicon`) to standardize icon format.
This commit is contained in:
27
database/factories/CityFactory.php
Normal file
27
database/factories/CityFactory.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
/**
|
||||
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\City>
|
||||
*/
|
||||
class CityFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'name' => fake()->city(),
|
||||
'country_id' => 1,
|
||||
'longitude' => fake()->longitude(),
|
||||
'latitude' => fake()->latitude(),
|
||||
'created_by' => \App\Models\User::factory(),
|
||||
];
|
||||
}
|
||||
}
|
||||
25
database/factories/CountryFactory.php
Normal file
25
database/factories/CountryFactory.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
/**
|
||||
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Country>
|
||||
*/
|
||||
class CountryFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'name' => fake()->country(),
|
||||
'code' => fake()->countryCode(),
|
||||
'language_codes' => ['en'],
|
||||
];
|
||||
}
|
||||
}
|
||||
28
database/factories/MeetupFactory.php
Normal file
28
database/factories/MeetupFactory.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
/**
|
||||
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Meetup>
|
||||
*/
|
||||
class MeetupFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
$name = fake()->company();
|
||||
|
||||
return [
|
||||
'name' => $name,
|
||||
'slug' => \Illuminate\Support\Str::slug($name),
|
||||
'github_data' => [],
|
||||
'created_by' => \App\Models\User::factory(),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('meetup_events', function (Blueprint $table) {
|
||||
$table->string('recurrence_type')->nullable()->after('start');
|
||||
$table->string('recurrence_day_of_week')->nullable()->after('recurrence_type');
|
||||
$table->string('recurrence_day_position')->nullable()->after('recurrence_day_of_week');
|
||||
$table->unsignedInteger('recurrence_interval')->default(1)->after('recurrence_day_position');
|
||||
$table->dateTime('recurrence_end_date')->nullable()->after('recurrence_interval');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('meetup_events', function (Blueprint $table) {
|
||||
$table->dropColumn([
|
||||
'recurrence_type',
|
||||
'recurrence_day_of_week',
|
||||
'recurrence_day_position',
|
||||
'recurrence_interval',
|
||||
'recurrence_end_date',
|
||||
]);
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user