feat(seeder): add WebsiteTypeSeeder and update DatabaseSeeder to include it
This commit is contained in:
@@ -23,6 +23,7 @@ class DatabaseSeeder extends Seeder
|
||||
]);
|
||||
|
||||
$this->call([
|
||||
WebsiteTypeSeeder::class,
|
||||
SocialMediaSeeder::class,
|
||||
TenantSeeder::class,
|
||||
AttributeSeeder::class,
|
||||
|
||||
103
database/seeders/WebsiteTypeSeeder.php
Normal file
103
database/seeders/WebsiteTypeSeeder.php
Normal file
@@ -0,0 +1,103 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use App\Domains\Tenant\Models\WebsiteType;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class WebsiteTypeSeeder extends Seeder
|
||||
{
|
||||
public function run(): void
|
||||
{
|
||||
$shopIt = WebsiteType::query()->updateOrCreate(
|
||||
['codigo' => 'shopit'],
|
||||
['nombre' => 'ShopIt'],
|
||||
);
|
||||
|
||||
$shopIt->extras()->updateOrCreate(
|
||||
['nombre' => 'carousel'],
|
||||
[
|
||||
'descripcion' => 'Listado de attachments que se muestran en el carousel principal.',
|
||||
'is_required' => false,
|
||||
'config_schema' => [
|
||||
'request_rules' => [
|
||||
'$' => 'required|array|max:10',
|
||||
'$.*' => 'required|image_or_base64|distinct',
|
||||
],
|
||||
'transforms' => [
|
||||
'$.*' => [
|
||||
'handler' => 'attachment',
|
||||
'attachment_type' => 'image',
|
||||
],
|
||||
],
|
||||
'database_rules' => [
|
||||
'$' => 'required|array',
|
||||
'$.*' => 'required|integer|distinct|exists:attachments,id',
|
||||
],
|
||||
],
|
||||
],
|
||||
);
|
||||
|
||||
$onTicket = WebsiteType::query()->updateOrCreate(
|
||||
['codigo' => 'onticket'],
|
||||
['nombre' => 'OnTicket'],
|
||||
);
|
||||
|
||||
$onTicket->extras()->updateOrCreate(
|
||||
['nombre' => 'heroConfig'],
|
||||
[
|
||||
'descripcion' => 'Configuracion del hero principal del evento.',
|
||||
'is_required' => false,
|
||||
'config_schema' => [
|
||||
'request_rules' => [
|
||||
'$' => 'required|array',
|
||||
'title_html' => 'nullable|string',
|
||||
'description_html' => 'nullable|string',
|
||||
'button_text' => 'nullable|string',
|
||||
'button_href' => 'nullable|string',
|
||||
'background_image_id' => 'nullable|image_or_base64',
|
||||
],
|
||||
'transforms' => [
|
||||
'background_image_id' => [
|
||||
'handler' => 'attachment',
|
||||
'attachment_type' => 'image',
|
||||
],
|
||||
],
|
||||
'database_rules' => [
|
||||
'$' => 'required|array',
|
||||
'title_html' => 'nullable|string',
|
||||
'description_html' => 'nullable|string',
|
||||
'button_text' => 'nullable|string',
|
||||
'button_href' => 'nullable|string',
|
||||
'background_image_id' => 'nullable|integer|exists:attachments,id',
|
||||
],
|
||||
],
|
||||
],
|
||||
);
|
||||
|
||||
$onTicket->extras()->updateOrCreate(
|
||||
['nombre' => 'eventConfig'],
|
||||
[
|
||||
'descripcion' => 'Informacion principal del evento.',
|
||||
'is_required' => false,
|
||||
'config_schema' => [
|
||||
'request_rules' => [
|
||||
'$' => 'required|array',
|
||||
'title' => 'nullable|string',
|
||||
'location' => 'nullable|string',
|
||||
'dates' => 'nullable|array',
|
||||
'dates.*' => 'required|date_format:Y-m-d|distinct',
|
||||
],
|
||||
'transforms' => [],
|
||||
'database_rules' => [
|
||||
'$' => 'required|array',
|
||||
'title' => 'nullable|string',
|
||||
'location' => 'nullable|string',
|
||||
'dates' => 'nullable|array',
|
||||
'dates.*' => 'required|date_format:Y-m-d|distinct',
|
||||
],
|
||||
],
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user