Inhaltsverwaltung: Bilder, Webseiten-Texte, Ausstattung, FAQ, Hinweis-Banner

- Bilder mit automatischen WebP-Webgrößen (640/1280/2048 px), Sortierung per Drag & Drop, Mehrfach-Upload, Import-Befehl photos:import
- Webseiten-Texte als feste, bearbeitbare Bausteine (config/content.php), Rich-Text bereinigt ausgegeben
- Ausstattung und FAQ aus der bisherigen Webseite übernommen
- Rolle Inhalte hat Zugriff auf alle Webseiten-Bereiche

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Lars StommerandClaude Opus 5.5 committed 2026-10-22 10:19:51 +02:00
1 parent 27ea12901e
commit bb7eb62782
53 files changed
+1963 -1

No files matched your search

+30
View File
@@ -0,0 +1,30 @@
<?php
namespace Database\Factories;
use App\Enums\AmenityArea;
use App\Models\Amenity;
use App\Models\Property;
use Illuminate\Database\Eloquent\Factories\Factory;
/**
* @extends Factory<Amenity>
*/
class AmenityFactory extends Factory
{
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
return [
'property_id' => Property::factory(),
'area' => AmenityArea::General,
'name' => fake()->words(2, true),
'is_highlight' => false,
'sort_order' => 0,
];
}
}
+27
View File
@@ -0,0 +1,27 @@
<?php
namespace Database\Factories;
use App\Models\Faq;
use Illuminate\Database\Eloquent\Factories\Factory;
/**
* @extends Factory<Faq>
*/
class FaqFactory extends Factory
{
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
return [
'question' => fake()->sentence().'?',
'answer' => '<p>'.fake()->paragraph().'</p>',
'is_published' => true,
'sort_order' => 0,
];
}
}
+27
View File
@@ -0,0 +1,27 @@
<?php
namespace Database\Factories;
use App\Enums\NoticeTone;
use App\Models\Notice;
use Illuminate\Database\Eloquent\Factories\Factory;
/**
* @extends Factory<Notice>
*/
class NoticeFactory extends Factory
{
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
return [
'text' => fake()->sentence(),
'tone' => NoticeTone::Info,
'is_active' => true,
];
}
}
+28
View File
@@ -0,0 +1,28 @@
<?php
namespace Database\Factories;
use App\Enums\PhotoCategory;
use App\Models\Photo;
use Illuminate\Database\Eloquent\Factories\Factory;
/**
* @extends Factory<Photo>
*/
class PhotoFactory extends Factory
{
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
return [
'category' => PhotoCategory::Apartment,
'alt_text' => fake()->sentence(3),
'is_published' => true,
'sort_order' => 0,
];
}
}
@@ -0,0 +1,33 @@
<?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::create('photos', function (Blueprint $table) {
$table->id();
$table->foreignId('property_id')->nullable()->constrained()->nullOnDelete();
$table->string('category');
$table->string('alt_text');
$table->string('caption')->nullable();
$table->boolean('is_published')->default(true);
$table->unsignedSmallInteger('sort_order')->default(0);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('photos');
}
};
@@ -0,0 +1,29 @@
<?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::create('content_blocks', function (Blueprint $table) {
$table->id();
$table->string('key')->unique();
$table->longText('value')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('content_blocks');
}
};
@@ -0,0 +1,31 @@
<?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::create('faqs', function (Blueprint $table) {
$table->id();
$table->string('question');
$table->text('answer');
$table->boolean('is_published')->default(true);
$table->unsignedSmallInteger('sort_order')->default(0);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('faqs');
}
};
@@ -0,0 +1,32 @@
<?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::create('amenities', function (Blueprint $table) {
$table->id();
$table->foreignId('property_id')->constrained()->cascadeOnDelete();
$table->string('area');
$table->string('name');
$table->boolean('is_highlight')->default(false);
$table->unsignedSmallInteger('sort_order')->default(0);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('amenities');
}
};
@@ -0,0 +1,34 @@
<?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::create('notices', function (Blueprint $table) {
$table->id();
$table->string('text');
$table->string('tone')->default('info');
$table->string('link_url')->nullable();
$table->string('link_label')->nullable();
$table->date('starts_on')->nullable();
$table->date('ends_on')->nullable();
$table->boolean('is_active')->default(true);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('notices');
}
};
+1 -1
View File
@@ -22,6 +22,6 @@ public function run(): void
'role' => UserRole::Admin,
]);
$this->call(PropertySeeder::class);
$this->call([PropertySeeder::class, WebsiteContentSeeder::class]);
}
}
+59
View File
@@ -0,0 +1,59 @@
<?php
namespace Database\Seeders;
use App\Enums\AmenityArea;
use App\Models\Faq;
use App\Models\Property;
use Illuminate\Database\Seeder;
/**
* Equipment list and FAQ taken over from the previous website. Only facts stated there.
*/
class WebsiteContentSeeder extends Seeder
{
/**
* Run the database seeds.
*/
public function run(): void
{
$property = Property::query()->firstOrFail();
$amenities = [
AmenityArea::General->value => ['Schnelles WLAN kostenlos', 'Pkw-Stellplatz inklusive', 'Abschließbarer Fahrradraum für 2 Räder', 'Diele mit großem Kleiderschrank und Spiegeln'],
AmenityArea::LivingRoom->value => ['Ledersofa und Sessel', 'Schrankbett 1,40 × 2,00 m', 'Kabel-TV', 'DVD-Player', 'HiFi-Anlage und Radio', 'Kleiner Schreibtisch'],
AmenityArea::Bedroom->value => ['Kingsize-Bett 1,80 m mit zwei Matratzen', 'Verdunkelungsrollo', 'Radiowecker', 'Nachttische mit Leselampen'],
AmenityArea::Kitchen->value => ['Einbauküche mit Backofen und Ceranfeld', 'Geschirrspüler', 'Mikrowelle', 'Kühlschrank mit großem Gefrierschrank', 'Kaffeemaschine, Wasserkocher, Toaster, Eierkocher', 'Esstisch mit Stühlen'],
AmenityArea::Bathroom->value => ['Dusche 90 × 90 cm mit niedrigem Einstieg', 'Beleuchteter Spiegelschrank', 'WC mit Sitzerhöhung', 'Föhn', 'Handtuchheizkörper'],
AmenityArea::Outdoor->value => ['Eigene Terrasse mit Gartenmöbeln', 'Blick auf Teich und Garten'],
];
$highlights = ['Schnelles WLAN kostenlos', 'Pkw-Stellplatz inklusive', 'Eigene Terrasse mit Gartenmöbeln', 'Kingsize-Bett 1,80 m mit zwei Matratzen', 'Geschirrspüler', 'Dusche 90 × 90 cm mit niedrigem Einstieg'];
$sort = 0;
foreach ($amenities as $area => $names) {
foreach ($names as $name) {
$property->amenities()->create([
'area' => $area,
'name' => $name,
'is_highlight' => in_array($name, $highlights, true),
'sort_order' => ++$sort,
]);
}
}
$faqs = [
'Was ist im Preis enthalten?' => '<p>Nebenkosten, WLAN, ein Pkw-Stellplatz und ein abschließbarer Fahrradraum für zwei Räder. Die Endreinigung wird einmalig pro Aufenthalt berechnet und ist im angezeigten Gesamtpreis enthalten.</p>',
'Kann ich Bettwäsche und Handtücher dazubuchen?' => '<p>Ja. Bettwäsche (die Betten sind bei Anreise bezogen) und Handtuchpakete können Sie bei der Anfrage auswählen.</p>',
'Wie viele Personen können übernachten?' => '<p>Die Wohnung ist für ein bis drei Personen geeignet: Kingsize-Bett im Schlafzimmer und ein Schrankbett im Wohnzimmer.</p>',
'Ist die Kurtaxe im Preis enthalten?' => '<p>Nein, die Kurtaxe der Gemeinde Kühlungsborn wird vor Ort bezahlt.</p>',
'Wie läuft die Bezahlung?' => '<p>Nach unserer Buchungsbestätigung überweisen Sie eine Anzahlung; der Restbetrag ist vier Wochen vor Anreise fällig.</p>',
'Ist meine Anfrage verbindlich?' => '<p>Nein. Wir merken den Termin für Sie vor und bestätigen kurzfristig. Erst mit unserer Bestätigung wird die Buchung verbindlich.</p>',
];
$sort = 0;
foreach ($faqs as $question => $answer) {
Faq::create(['question' => $question, 'answer' => $answer, 'sort_order' => ++$sort]);
}
}
}