Neue JSON-Spalte plans.benefits (Migration + Cast + Plan::benefitsList()). Im Admin (Tarife & Pakete) pro Tarif zeilenweise pflegbar; die In-App- Buchungsseite rendert die Liste in den Tarif-Karten statt einer festen Zeile. Seeder/Factory mit Beispiel-Vorteilen. Single Source of Truth fuer Buchungsseite und (folgt separat) die oeffentliche Preise-Seite. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
40 lines
1 KiB
PHP
40 lines
1 KiB
PHP
<?php
|
|
|
|
namespace Database\Factories;
|
|
|
|
use App\Models\Plan;
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
|
|
/**
|
|
* @extends Factory<Plan>
|
|
*/
|
|
class PlanFactory extends Factory
|
|
{
|
|
protected $model = Plan::class;
|
|
|
|
public function definition(): array
|
|
{
|
|
$monthly = fake()->numberBetween(19, 199) * 100;
|
|
|
|
return [
|
|
'slug' => fake()->unique()->slug(2),
|
|
'name' => fake()->words(2, true),
|
|
'monthly_price_cents' => $monthly,
|
|
'yearly_price_cents' => $monthly * 10,
|
|
'currency' => 'EUR',
|
|
'press_release_quota' => fake()->numberBetween(3, 60),
|
|
'daily_limit' => null,
|
|
'is_active' => true,
|
|
'sort_order' => fake()->numberBetween(0, 10),
|
|
'benefits' => [
|
|
'Redaktionelle Prüfung inklusive',
|
|
fake()->sentence(4),
|
|
],
|
|
];
|
|
}
|
|
|
|
public function inactive(): static
|
|
{
|
|
return $this->state(fn (): array => ['is_active' => false]);
|
|
}
|
|
}
|