feat: modalidades de casamento e etapas corporativas
This commit is contained in:
@@ -212,6 +212,26 @@ class ManageSiteSettings extends Page
|
|||||||
->reorderable()
|
->reorderable()
|
||||||
->columnSpanFull(),
|
->columnSpanFull(),
|
||||||
]),
|
]),
|
||||||
|
Section::make('Corporate')
|
||||||
|
->description('Etapas apresentadas na frente Amare Corporate da home.')
|
||||||
|
->schema([
|
||||||
|
Repeater::make('corporate_steps')
|
||||||
|
->label('Etapas do serviço corporativo')
|
||||||
|
->schema([
|
||||||
|
TextInput::make('title')
|
||||||
|
->label('Título')
|
||||||
|
->required()
|
||||||
|
->maxLength(255),
|
||||||
|
Textarea::make('body')
|
||||||
|
->label('Descrição')
|
||||||
|
->required()
|
||||||
|
->rows(2),
|
||||||
|
])
|
||||||
|
->defaultItems(3)
|
||||||
|
->maxItems(6)
|
||||||
|
->reorderable()
|
||||||
|
->columnSpanFull(),
|
||||||
|
]),
|
||||||
Section::make('Princípios')
|
Section::make('Princípios')
|
||||||
->schema([
|
->schema([
|
||||||
TagsInput::make('principles')
|
TagsInput::make('principles')
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\WeddingPackages\Pages;
|
||||||
|
|
||||||
|
use App\Filament\Resources\WeddingPackages\WeddingPackageResource;
|
||||||
|
use Filament\Resources\Pages\CreateRecord;
|
||||||
|
|
||||||
|
class CreateWeddingPackage extends CreateRecord
|
||||||
|
{
|
||||||
|
protected static string $resource = WeddingPackageResource::class;
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\WeddingPackages\Pages;
|
||||||
|
|
||||||
|
use App\Filament\Resources\WeddingPackages\WeddingPackageResource;
|
||||||
|
use Filament\Resources\Pages\EditRecord;
|
||||||
|
|
||||||
|
class EditWeddingPackage extends EditRecord
|
||||||
|
{
|
||||||
|
protected static string $resource = WeddingPackageResource::class;
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\WeddingPackages\Pages;
|
||||||
|
|
||||||
|
use App\Filament\Resources\WeddingPackages\WeddingPackageResource;
|
||||||
|
use Filament\Actions\CreateAction;
|
||||||
|
use Filament\Resources\Pages\ListRecords;
|
||||||
|
|
||||||
|
class ListWeddingPackages extends ListRecords
|
||||||
|
{
|
||||||
|
protected static string $resource = WeddingPackageResource::class;
|
||||||
|
|
||||||
|
protected function getHeaderActions(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
CreateAction::make(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\WeddingPackages\Schemas;
|
||||||
|
|
||||||
|
use Filament\Forms\Components\DateTimePicker;
|
||||||
|
use Filament\Forms\Components\Repeater;
|
||||||
|
use Filament\Forms\Components\Textarea;
|
||||||
|
use Filament\Forms\Components\TextInput;
|
||||||
|
use Filament\Schemas\Schema;
|
||||||
|
|
||||||
|
class WeddingPackageForm
|
||||||
|
{
|
||||||
|
public static function configure(Schema $schema): Schema
|
||||||
|
{
|
||||||
|
return $schema
|
||||||
|
->components([
|
||||||
|
TextInput::make('eyebrow')
|
||||||
|
->label('Número / tipo (ex.: 01 / COMPLETA)')
|
||||||
|
->required()
|
||||||
|
->maxLength(255),
|
||||||
|
TextInput::make('title')
|
||||||
|
->label('Nome da modalidade')
|
||||||
|
->required()
|
||||||
|
->maxLength(255),
|
||||||
|
Textarea::make('description')
|
||||||
|
->label('Descrição')
|
||||||
|
->required()
|
||||||
|
->rows(4),
|
||||||
|
Repeater::make('items')
|
||||||
|
->label('O que está incluído')
|
||||||
|
->schema([
|
||||||
|
TextInput::make('item')
|
||||||
|
->label('Item')
|
||||||
|
->required()
|
||||||
|
->maxLength(255),
|
||||||
|
])
|
||||||
|
->defaultItems(4)
|
||||||
|
->minItems(1)
|
||||||
|
->addActionLabel('Adicionar item')
|
||||||
|
->required(),
|
||||||
|
TextInput::make('sort_order')
|
||||||
|
->label('Ordem')
|
||||||
|
->numeric()
|
||||||
|
->default(0)
|
||||||
|
->required(),
|
||||||
|
DateTimePicker::make('published_at')
|
||||||
|
->label('Publicado em')
|
||||||
|
->seconds(false),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,50 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\WeddingPackages\Tables;
|
||||||
|
|
||||||
|
use Filament\Actions\BulkActionGroup;
|
||||||
|
use Filament\Actions\DeleteAction;
|
||||||
|
use Filament\Actions\DeleteBulkAction;
|
||||||
|
use Filament\Actions\EditAction;
|
||||||
|
use Filament\Tables\Columns\TextColumn;
|
||||||
|
use Filament\Tables\Table;
|
||||||
|
|
||||||
|
class WeddingPackagesTable
|
||||||
|
{
|
||||||
|
public static function configure(Table $table): Table
|
||||||
|
{
|
||||||
|
return $table
|
||||||
|
->columns([
|
||||||
|
TextColumn::make('eyebrow')
|
||||||
|
->label('Número / tipo')
|
||||||
|
->searchable(),
|
||||||
|
TextColumn::make('title')
|
||||||
|
->label('Nome')
|
||||||
|
->searchable()
|
||||||
|
->sortable(),
|
||||||
|
TextColumn::make('published_at')
|
||||||
|
->label('Publicado em')
|
||||||
|
->dateTime()
|
||||||
|
->sortable(),
|
||||||
|
TextColumn::make('sort_order')
|
||||||
|
->label('Ordem')
|
||||||
|
->sortable(),
|
||||||
|
])
|
||||||
|
->defaultSort('sort_order')
|
||||||
|
->filters([
|
||||||
|
//
|
||||||
|
])
|
||||||
|
->recordActions([
|
||||||
|
EditAction::make(),
|
||||||
|
DeleteAction::make()
|
||||||
|
->requiresConfirmation(),
|
||||||
|
])
|
||||||
|
->toolbarActions([
|
||||||
|
BulkActionGroup::make([
|
||||||
|
DeleteBulkAction::make(),
|
||||||
|
]),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\WeddingPackages;
|
||||||
|
|
||||||
|
use App\Filament\Resources\WeddingPackages\Pages\CreateWeddingPackage;
|
||||||
|
use App\Filament\Resources\WeddingPackages\Pages\EditWeddingPackage;
|
||||||
|
use App\Filament\Resources\WeddingPackages\Pages\ListWeddingPackages;
|
||||||
|
use App\Filament\Resources\WeddingPackages\Schemas\WeddingPackageForm;
|
||||||
|
use App\Filament\Resources\WeddingPackages\Tables\WeddingPackagesTable;
|
||||||
|
use App\Models\WeddingPackage;
|
||||||
|
use App\Policies\WeddingPackagePolicy;
|
||||||
|
use BackedEnum;
|
||||||
|
use Filament\Resources\Resource;
|
||||||
|
use Filament\Schemas\Schema;
|
||||||
|
use Filament\Support\Icons\Heroicon;
|
||||||
|
use Filament\Tables\Table;
|
||||||
|
use UnitEnum;
|
||||||
|
|
||||||
|
class WeddingPackageResource extends Resource
|
||||||
|
{
|
||||||
|
protected static ?string $model = WeddingPackage::class;
|
||||||
|
|
||||||
|
protected static ?string $policy = WeddingPackagePolicy::class;
|
||||||
|
|
||||||
|
protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedRectangleStack;
|
||||||
|
|
||||||
|
protected static ?string $navigationLabel = 'Modalidades';
|
||||||
|
|
||||||
|
protected static ?string $modelLabel = 'modalidade';
|
||||||
|
|
||||||
|
protected static ?string $pluralModelLabel = 'modalidades';
|
||||||
|
|
||||||
|
protected static string|UnitEnum|null $navigationGroup = 'Conteúdo do site';
|
||||||
|
|
||||||
|
protected static ?int $navigationSort = 3;
|
||||||
|
|
||||||
|
public static function form(Schema $schema): Schema
|
||||||
|
{
|
||||||
|
return WeddingPackageForm::configure($schema);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function table(Table $table): Table
|
||||||
|
{
|
||||||
|
return WeddingPackagesTable::configure($table);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getRelations(): array
|
||||||
|
{
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getPages(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'index' => ListWeddingPackages::route('/'),
|
||||||
|
'create' => CreateWeddingPackage::route('/create'),
|
||||||
|
'edit' => EditWeddingPackage::route('/{record}/edit'),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -12,6 +12,7 @@ use Illuminate\Database\Eloquent\Model;
|
|||||||
/**
|
/**
|
||||||
* @property array<string, string|null> $social_links
|
* @property array<string, string|null> $social_links
|
||||||
* @property list<array{title?: string, body?: string}>|null $method_steps
|
* @property list<array{title?: string, body?: string}>|null $method_steps
|
||||||
|
* @property list<array{title?: string, body?: string}>|null $corporate_steps
|
||||||
* @property list<string>|null $principles
|
* @property list<string>|null $principles
|
||||||
* @property bool $analytics_enabled
|
* @property bool $analytics_enabled
|
||||||
* @property string|null $default_og_image_path
|
* @property string|null $default_og_image_path
|
||||||
@@ -51,6 +52,7 @@ use Illuminate\Database\Eloquent\Model;
|
|||||||
'manifesto_body',
|
'manifesto_body',
|
||||||
'method_intro',
|
'method_intro',
|
||||||
'method_steps',
|
'method_steps',
|
||||||
|
'corporate_steps',
|
||||||
'principles',
|
'principles',
|
||||||
'email',
|
'email',
|
||||||
'phone',
|
'phone',
|
||||||
@@ -82,6 +84,7 @@ class SiteSetting extends Model
|
|||||||
'manifesto_body' => 'A Amare combina sensibilidade e precisão para criar encontros coerentes com cada cliente, marca e ocasião — sem fórmulas prontas, excessos ou ruído.',
|
'manifesto_body' => 'A Amare combina sensibilidade e precisão para criar encontros coerentes com cada cliente, marca e ocasião — sem fórmulas prontas, excessos ou ruído.',
|
||||||
'method_intro' => 'Clareza em cada etapa. Tranquilidade durante todo o processo.',
|
'method_intro' => 'Clareza em cada etapa. Tranquilidade durante todo o processo.',
|
||||||
'method_steps' => self::defaultMethodSteps(),
|
'method_steps' => self::defaultMethodSteps(),
|
||||||
|
'corporate_steps' => self::defaultCorporateSteps(),
|
||||||
'principles' => self::defaultPrinciples(),
|
'principles' => self::defaultPrinciples(),
|
||||||
'email' => 'amareassessoriaeventos@gmail.com',
|
'email' => 'amareassessoriaeventos@gmail.com',
|
||||||
'phone' => '(11) 99999-9999',
|
'phone' => '(11) 99999-9999',
|
||||||
@@ -118,6 +121,27 @@ class SiteSetting extends Model
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return list<array{title: string, body: string}>
|
||||||
|
*/
|
||||||
|
public static function defaultCorporateSteps(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
[
|
||||||
|
'title' => 'Planejamento',
|
||||||
|
'body' => 'Estruturação de escopo, cronograma e prioridades.',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'title' => 'Produção',
|
||||||
|
'body' => 'Coordenação dos elementos necessários para colocar o evento de pé.',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'title' => 'Execução',
|
||||||
|
'body' => 'Condução e acompanhamento do evento conforme o projeto aprovado.',
|
||||||
|
],
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return list<string>
|
* @return list<string>
|
||||||
*/
|
*/
|
||||||
@@ -139,6 +163,7 @@ class SiteSetting extends Model
|
|||||||
return [
|
return [
|
||||||
'social_links' => 'array',
|
'social_links' => 'array',
|
||||||
'method_steps' => 'array',
|
'method_steps' => 'array',
|
||||||
|
'corporate_steps' => 'array',
|
||||||
'principles' => 'array',
|
'principles' => 'array',
|
||||||
'analytics_enabled' => 'boolean',
|
'analytics_enabled' => 'boolean',
|
||||||
];
|
];
|
||||||
|
|||||||
51
app/Models/WeddingPackage.php
Normal file
51
app/Models/WeddingPackage.php
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace App\Models;
|
||||||
|
|
||||||
|
use App\Models\Concerns\HasPublication;
|
||||||
|
use App\Policies\WeddingPackagePolicy;
|
||||||
|
use Database\Factories\WeddingPackageFactory;
|
||||||
|
use Illuminate\Database\Eloquent\Attributes\Fillable;
|
||||||
|
use Illuminate\Database\Eloquent\Attributes\UsePolicy;
|
||||||
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
use Illuminate\Support\Carbon;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @property string $eyebrow
|
||||||
|
* @property string $title
|
||||||
|
* @property string $description
|
||||||
|
* @property list<string> $items
|
||||||
|
* @property int $sort_order
|
||||||
|
* @property Carbon|null $published_at
|
||||||
|
*/
|
||||||
|
#[Fillable([
|
||||||
|
'eyebrow',
|
||||||
|
'title',
|
||||||
|
'description',
|
||||||
|
'items',
|
||||||
|
'sort_order',
|
||||||
|
'published_at',
|
||||||
|
])]
|
||||||
|
#[UsePolicy(WeddingPackagePolicy::class)]
|
||||||
|
class WeddingPackage extends Model
|
||||||
|
{
|
||||||
|
/** @use HasFactory<WeddingPackageFactory> */
|
||||||
|
use HasFactory;
|
||||||
|
|
||||||
|
use HasPublication;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return array<string, string|class-string>
|
||||||
|
*/
|
||||||
|
protected function casts(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'items' => 'array',
|
||||||
|
'published_at' => 'datetime',
|
||||||
|
'sort_order' => 'integer',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
46
app/Policies/WeddingPackagePolicy.php
Normal file
46
app/Policies/WeddingPackagePolicy.php
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace App\Policies;
|
||||||
|
|
||||||
|
use App\Models\User;
|
||||||
|
use App\Models\WeddingPackage;
|
||||||
|
|
||||||
|
class WeddingPackagePolicy
|
||||||
|
{
|
||||||
|
public function viewAny(User $user): bool
|
||||||
|
{
|
||||||
|
return $user->isAdmin();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function view(User $user, WeddingPackage $weddingPackage): bool
|
||||||
|
{
|
||||||
|
return $user->isAdmin();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function create(User $user): bool
|
||||||
|
{
|
||||||
|
return $user->isAdmin();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function update(User $user, WeddingPackage $weddingPackage): bool
|
||||||
|
{
|
||||||
|
return $user->isAdmin();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function delete(User $user, WeddingPackage $weddingPackage): bool
|
||||||
|
{
|
||||||
|
return $user->isAdmin();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function restore(User $user, WeddingPackage $weddingPackage): bool
|
||||||
|
{
|
||||||
|
return $user->isAdmin();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function forceDelete(User $user, WeddingPackage $weddingPackage): bool
|
||||||
|
{
|
||||||
|
return $user->isAdmin();
|
||||||
|
}
|
||||||
|
}
|
||||||
43
database/factories/WeddingPackageFactory.php
Normal file
43
database/factories/WeddingPackageFactory.php
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace Database\Factories;
|
||||||
|
|
||||||
|
use App\Models\WeddingPackage;
|
||||||
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @extends Factory<WeddingPackage>
|
||||||
|
*/
|
||||||
|
class WeddingPackageFactory extends Factory
|
||||||
|
{
|
||||||
|
protected $model = WeddingPackage::class;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return array<string, mixed>
|
||||||
|
*/
|
||||||
|
public function definition(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'eyebrow' => '01 / COMPLETA',
|
||||||
|
'title' => fake()->unique()->words(2, true),
|
||||||
|
'description' => fake()->paragraph(),
|
||||||
|
'items' => [
|
||||||
|
fake()->sentence(),
|
||||||
|
fake()->sentence(),
|
||||||
|
fake()->sentence(),
|
||||||
|
fake()->sentence(),
|
||||||
|
],
|
||||||
|
'sort_order' => 0,
|
||||||
|
'published_at' => null,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function published(): static
|
||||||
|
{
|
||||||
|
return $this->state(fn (array $attributes): array => [
|
||||||
|
'published_at' => now(),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
public function up(): void
|
||||||
|
{
|
||||||
|
Schema::create('wedding_packages', function (Blueprint $table): void {
|
||||||
|
$table->id();
|
||||||
|
$table->string('eyebrow');
|
||||||
|
$table->string('title');
|
||||||
|
$table->text('description');
|
||||||
|
$table->json('items');
|
||||||
|
$table->integer('sort_order')->default(0)->index();
|
||||||
|
$table->timestamp('published_at')->nullable()->index();
|
||||||
|
$table->timestamps();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::dropIfExists('wedding_packages');
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
public function up(): void
|
||||||
|
{
|
||||||
|
Schema::table('site_settings', function (Blueprint $table): void {
|
||||||
|
$table->jsonb('corporate_steps')->nullable()->after('method_steps');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::table('site_settings', function (Blueprint $table): void {
|
||||||
|
$table->dropColumn('corporate_steps');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -49,6 +49,7 @@ class ContentSeeder extends Seeder
|
|||||||
$this->seedServices();
|
$this->seedServices();
|
||||||
$this->seedPortfolioCases();
|
$this->seedPortfolioCases();
|
||||||
$this->call(TestimonialsSeeder::class);
|
$this->call(TestimonialsSeeder::class);
|
||||||
|
$this->call(WeddingPackagesSeeder::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
private function seedSiteSettings(): void
|
private function seedSiteSettings(): void
|
||||||
@@ -75,6 +76,7 @@ class ContentSeeder extends Seeder
|
|||||||
'manifesto_body' => 'A Amare combina sensibilidade e precisão para criar encontros coerentes com cada cliente, marca e ocasião — sem fórmulas prontas, excessos ou ruído.',
|
'manifesto_body' => 'A Amare combina sensibilidade e precisão para criar encontros coerentes com cada cliente, marca e ocasião — sem fórmulas prontas, excessos ou ruído.',
|
||||||
'method_intro' => 'Clareza em cada etapa. Tranquilidade durante todo o processo.',
|
'method_intro' => 'Clareza em cada etapa. Tranquilidade durante todo o processo.',
|
||||||
'method_steps' => SiteSetting::defaultMethodSteps(),
|
'method_steps' => SiteSetting::defaultMethodSteps(),
|
||||||
|
'corporate_steps' => SiteSetting::defaultCorporateSteps(),
|
||||||
'principles' => SiteSetting::defaultPrinciples(),
|
'principles' => SiteSetting::defaultPrinciples(),
|
||||||
'email' => 'amareassessoriaeventos@gmail.com',
|
'email' => 'amareassessoriaeventos@gmail.com',
|
||||||
'phone' => '(11) 99999-9999',
|
'phone' => '(11) 99999-9999',
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ class VisualContentSeeder extends Seeder
|
|||||||
$this->seedServices();
|
$this->seedServices();
|
||||||
$this->seedPortfolioCases();
|
$this->seedPortfolioCases();
|
||||||
$this->seedTestimonials();
|
$this->seedTestimonials();
|
||||||
|
$this->call(WeddingPackagesSeeder::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
private function seedSiteSettings(): void
|
private function seedSiteSettings(): void
|
||||||
@@ -56,6 +57,7 @@ class VisualContentSeeder extends Seeder
|
|||||||
'manifesto_body' => 'A Amare combina sensibilidade e precisão para criar encontros coerentes com cada cliente, marca e ocasião — sem fórmulas prontas, excessos ou ruído.',
|
'manifesto_body' => 'A Amare combina sensibilidade e precisão para criar encontros coerentes com cada cliente, marca e ocasião — sem fórmulas prontas, excessos ou ruído.',
|
||||||
'method_intro' => 'Clareza em cada etapa. Tranquilidade durante todo o processo.',
|
'method_intro' => 'Clareza em cada etapa. Tranquilidade durante todo o processo.',
|
||||||
'method_steps' => SiteSetting::defaultMethodSteps(),
|
'method_steps' => SiteSetting::defaultMethodSteps(),
|
||||||
|
'corporate_steps' => SiteSetting::defaultCorporateSteps(),
|
||||||
'principles' => SiteSetting::defaultPrinciples(),
|
'principles' => SiteSetting::defaultPrinciples(),
|
||||||
'email' => 'amareassessoriaeventos@gmail.com',
|
'email' => 'amareassessoriaeventos@gmail.com',
|
||||||
'phone' => '(11) 99999-9999',
|
'phone' => '(11) 99999-9999',
|
||||||
|
|||||||
77
database/seeders/WeddingPackagesSeeder.php
Normal file
77
database/seeders/WeddingPackagesSeeder.php
Normal file
@@ -0,0 +1,77 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace Database\Seeders;
|
||||||
|
|
||||||
|
use App\Models\WeddingPackage;
|
||||||
|
use Illuminate\Database\Seeder;
|
||||||
|
use Illuminate\Support\Carbon;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Wedding package modalities shown on the home page (03 — Amare Casamentos).
|
||||||
|
* Copy is approved from the structural model preview (preview(1).html) and
|
||||||
|
* remains editable via the Filament resource.
|
||||||
|
*/
|
||||||
|
class WeddingPackagesSeeder extends Seeder
|
||||||
|
{
|
||||||
|
private const PUBLISHED_AT = '2026-08-11 00:00:00';
|
||||||
|
|
||||||
|
public function run(): void
|
||||||
|
{
|
||||||
|
$packages = [
|
||||||
|
[
|
||||||
|
'eyebrow' => '01 / COMPLETA',
|
||||||
|
'title' => 'Essenza',
|
||||||
|
'description' => 'Para casais que desejam contar com a Amare desde o planejamento até a realização do casamento.',
|
||||||
|
'items' => [
|
||||||
|
'Planejamento e organização',
|
||||||
|
'Gestão de etapas e prioridades',
|
||||||
|
'Acompanhamento de fornecedores',
|
||||||
|
'Coordenação do grande dia',
|
||||||
|
],
|
||||||
|
'sort_order' => 1,
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'eyebrow' => '02 / PARCIAL',
|
||||||
|
'title' => 'Conduzione',
|
||||||
|
'description' => 'Para quem já começou e deseja estruturar o que falta, organizar fornecedores e seguir com acompanhamento profissional.',
|
||||||
|
'items' => [
|
||||||
|
'Diagnóstico do planejamento',
|
||||||
|
'Organização das pendências',
|
||||||
|
'Gestão dos próximos passos',
|
||||||
|
'Coordenação do grande dia',
|
||||||
|
],
|
||||||
|
'sort_order' => 2,
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'eyebrow' => '03 / FINAL',
|
||||||
|
'title' => 'Grand Jour',
|
||||||
|
'description' => 'Para casais que já planejaram o casamento e precisam de uma equipe para assumir alinhamentos e operação na reta final.',
|
||||||
|
'items' => [
|
||||||
|
'Imersão no planejamento existente',
|
||||||
|
'Alinhamento de fornecedores',
|
||||||
|
'Cronograma final',
|
||||||
|
'Gestão da operação do evento',
|
||||||
|
],
|
||||||
|
'sort_order' => 3,
|
||||||
|
],
|
||||||
|
];
|
||||||
|
|
||||||
|
DB::transaction(function () use ($packages): void {
|
||||||
|
foreach ($packages as $package) {
|
||||||
|
WeddingPackage::query()->updateOrCreate(
|
||||||
|
['title' => $package['title']],
|
||||||
|
[
|
||||||
|
'eyebrow' => $package['eyebrow'],
|
||||||
|
'description' => $package['description'],
|
||||||
|
'items' => $package['items'],
|
||||||
|
'sort_order' => $package['sort_order'],
|
||||||
|
'published_at' => Carbon::parse(self::PUBLISHED_AT),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -9,6 +9,7 @@ use App\Models\PortfolioCase;
|
|||||||
use App\Models\Service;
|
use App\Models\Service;
|
||||||
use App\Models\SiteSetting;
|
use App\Models\SiteSetting;
|
||||||
use App\Models\Testimonial;
|
use App\Models\Testimonial;
|
||||||
|
use App\Models\WeddingPackage;
|
||||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||||
use Tests\TestCase;
|
use Tests\TestCase;
|
||||||
|
|
||||||
@@ -33,6 +34,10 @@ class GetHomeContentTest extends TestCase
|
|||||||
$testimonialB = Testimonial::factory()->published()->create(['author_name' => 'Author B', 'sort_order' => 20]);
|
$testimonialB = Testimonial::factory()->published()->create(['author_name' => 'Author B', 'sort_order' => 20]);
|
||||||
$testimonialA = Testimonial::factory()->published()->create(['author_name' => 'Author A', 'sort_order' => 10]);
|
$testimonialA = Testimonial::factory()->published()->create(['author_name' => 'Author A', 'sort_order' => 10]);
|
||||||
|
|
||||||
|
WeddingPackage::factory()->create(['title' => 'Draft Package', 'published_at' => null]);
|
||||||
|
$packageB = WeddingPackage::factory()->published()->create(['title' => 'Package B', 'sort_order' => 20]);
|
||||||
|
$packageA = WeddingPackage::factory()->published()->create(['title' => 'Package A', 'sort_order' => 10]);
|
||||||
|
|
||||||
$content = (new GetHomeContent)();
|
$content = (new GetHomeContent)();
|
||||||
|
|
||||||
$this->assertTrue($content->settings->is($settings));
|
$this->assertTrue($content->settings->is($settings));
|
||||||
@@ -46,5 +51,8 @@ class GetHomeContentTest extends TestCase
|
|||||||
$this->assertCount(2, $content->testimonials);
|
$this->assertCount(2, $content->testimonials);
|
||||||
$this->assertTrue($content->testimonials->get(0)?->is($testimonialA));
|
$this->assertTrue($content->testimonials->get(0)?->is($testimonialA));
|
||||||
$this->assertTrue($content->testimonials->get(1)?->is($testimonialB));
|
$this->assertTrue($content->testimonials->get(1)?->is($testimonialB));
|
||||||
|
$this->assertCount(2, $content->packages);
|
||||||
|
$this->assertTrue($content->packages->get(0)?->is($packageA));
|
||||||
|
$this->assertTrue($content->packages->get(1)?->is($packageB));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user