add SlideFactory to Slide model and update DatabaseSeeder to include SlideSeeder for improved data seeding

This commit is contained in:
F4ilji
2025-08-11 22:27:15 +05:00
parent be68399ab8
commit e34d49b3f4
7 changed files with 266 additions and 9 deletions
+96
View File
@@ -0,0 +1,96 @@
<?php
namespace App\Ship\Seeders;
use App\Containers\Widget\Models\ContactWidget;
use App\Ship\Abstracts\Seeders\Seeder;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
class ContactWidgetSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
$data = [
'id' => 1,
'title' => 'Главная страница контакты',
'slug' => 'glavnaia-stranica-kontakty',
'content' => [
[
"title" => "Контакты",
"items" => [
[
"header" => "Главный корпус",
"details" => [
[
"content" => "622031, Свердловская обл. Нижний Тагил ул. Красногвардейская, 57",
"url" => null
]
]
],
[
"header" => "Свяжитесь с нами",
"details" => [
[
"content" => "(3435) 25-48-00",
"url" => null
],
[
"content" => "office@ntspi.ru",
"url" => null
]
]
]
]
],
[
"title" => "Приемная комиссия",
"items" => [
[
"header" => "Расписание",
"details" => [
[
"content" => "Понедельник - Пятница с 08.30 до 17.00",
"url" => null
]
]
]
]
],
[
"title" => "Полезное",
"items" => [
[
"header" => "Главный корпус",
"details" => [
[
"content" => "Виртуальный тур",
"url" => "https://ntspi.ru/panorama/tour.html"
]
]
],
[
"header" => "Корпус ФХО",
"details" => [
[
"content" => "Проспект Мира, 25",
"url" => null
]
]
]
]
]
],
'is_active' => 1,
'created_at' => '2025-01-09 12:50:17',
'updated_at' => '2025-05-20 09:18:46',
];
ContactWidget::create($data);
}
}
@@ -0,0 +1,38 @@
<?php
namespace App\Ship\Seeders;
use App\Containers\Widget\Models\PageReferenceList;
use App\Ship\Abstracts\Seeders\Seeder;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
class PageReferenceListSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
$data = [
'id' => 1,
'title' => 'Главная страница ресурс',
'slug' => 'glavnaia-stranica-resurs',
'content' => array(
['model_select' => null, 'title' => 'Система Moodle НТГСПИ', 'image' => [], 'icon' => 'heroicon-o-academic-cap', 'link' => 'https://do.ntspi.ru/', 'link_text' => 'Перейти'],
['model_select' => null, 'title' => 'ЭИОС', 'image' => [], 'icon' => 'heroicon-o-computer-desktop', 'link' => 'https://eios.rsvpu.ru/', 'link_text' => 'Перейти'],
['model_select' => 'Custom', 'title' => 'Группа Вконтакте', 'image' => [], 'icon' => 'heroicon-c-user-group', 'link' => 'https://vk.com/ntspi', 'link_text' => 'Читать', 'content' => null],
['model_select' => 'Custom', 'title' => 'Книга почёта', 'image' => [], 'link' => 'http://book.ntspi.ru/', 'link_text' => 'Смотреть', 'content' => null, 'icon' => 'heroicon-o-book-open'],
['model_select' => 'Custom', 'title' => 'Поступление в ВУЗ онлайн', 'image' => [], 'link' => 'https://minobrnauki.gov.ru/press-center/news/novosti-ministerstva/50667/', 'link_text' => 'Читать', 'content' => null, 'icon' => 'heroicon-o-globe-alt'],
['model_select' => 'Custom', 'title' => 'Интернет олимпиады', 'image' => [], 'link' => 'https://olymp.i-exam.ru/', 'link_text' => 'Читать', 'content' => null, 'icon' => 'heroicon-o-cursor-arrow-rays'],
['model_select' => 'Custom', 'title' => 'РЕЕСТР рекомендуемых образовательных цифровых сервисов для использования в программах подготовки педагогических кадров', 'image' => [], 'link' => 'https://new.ntspi.ru/storage/files/reestr.pdf', 'link_text' => 'Смотреть', 'content' => null, 'icon' => 'heroicon-o-table-cells']
),
'is_active' => 1,
'created_at' => '2025-01-09 09:37:27',
'updated_at' => '2025-05-23 18:57:38',
];
PageReferenceList::create($data);
}
}
+26
View File
@@ -0,0 +1,26 @@
<?php
namespace App\Ship\Seeders;
use App\Containers\Widget\Models\Slider;
use App\Ship\Abstracts\Seeders\Seeder;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
class SliderSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
Slider::create([
'id' => 1,
'title' => 'quos-velit-quisquam',
'slug' => 'quos-velit-quisquam',
'is_active' => 1,
'created_at' => '2025-04-02 22:08:34',
'updated_at' => '2025-04-02 22:08:34',
]); }
}