From 2994775e27ad31cde7b8939119cebe92ef6a56fc Mon Sep 17 00:00:00 2001 From: Diatrex Date: Fri, 7 Feb 2020 15:38:04 +0300 Subject: [PATCH] #844 [demodata] Seed is not working with 3.7 --- database/seeds/DatabaseSeeder.php | 188 ------------------------------ 1 file changed, 188 deletions(-) diff --git a/database/seeds/DatabaseSeeder.php b/database/seeds/DatabaseSeeder.php index 36a5d4956..6b3cf6e72 100644 --- a/database/seeds/DatabaseSeeder.php +++ b/database/seeds/DatabaseSeeder.php @@ -2,217 +2,29 @@ use Anomaly\NavigationModule\Link\LinkModel; use Anomaly\NavigationModule\Menu\Contract\MenuRepositoryInterface; -use Anomaly\PagesModule\Page\Contract\PageRepositoryInterface; -use Anomaly\PagesModule\Page\PageModel; -use Anomaly\PagesModule\Type\Contract\TypeRepositoryInterface; use Anomaly\Streams\Platform\Entry\EntryRepository; -use Anomaly\Streams\Platform\Model\Settings\SettingsSettingsEntryModel; use Anomaly\UrlLinkTypeExtension\UrlLinkTypeModel; use Illuminate\Database\Seeder; -use Anomaly\ConfigurationModule\Configuration\Contract\ConfigurationRepositoryInterface; -use Anomaly\DashboardModule\Dashboard\Contract\DashboardRepositoryInterface; use Anomaly\DashboardModule\Widget\Contract\WidgetRepositoryInterface; use Illuminate\Database\Eloquent\Model; use Illuminate\Support\Facades\DB; class DatabaseSeeder extends Seeder { - protected $pages; - protected $types; protected $widgets; - protected $dashboards; - protected $configuration; protected $menus; public function __construct( - PageRepositoryInterface $pages, - TypeRepositoryInterface $types, WidgetRepositoryInterface $widgets, - DashboardRepositoryInterface $dashboards, - ConfigurationRepositoryInterface $configuration, MenuRepositoryInterface $menus ) { - $this->pages = $pages; - $this->types = $types; $this->widgets = $widgets; - $this->dashboards = $dashboards; - $this->configuration = $configuration; $this->menus = $menus; } public function run() { - \Anomaly\Streams\Platform\Model\Pages\PagesPagesEntryModel::query()->forceDelete(); - \Anomaly\Streams\Platform\Model\Pages\PagesDefaultPagesEntryModel::query()->forceDelete(); - $type = $this->types->findBySlug('default'); - - $this->pages->create( - [ - 'sort_order' => 1, - 'en' => [ - 'title' => 'OpenClassify', - ], - 'tr' => [ - 'title' => 'OpenClassify', - ], - 'slug' => 'welcome', - 'entry' => $type->getEntryModel()->create( - [ - 'en' => [ - 'content' => '

The extensible and most advanced open source classified app build with Laravel.

', - ], - 'tr' => [ - 'content' => '

Laravel tabanlı Mödüler yapıya sahip En Gelişmiş İlan Platformu.

', - ], - ] - ), - 'type' => $type, - 'enabled' => true, - 'home' => true, - 'theme_layout' => 'theme::layouts/default.twig', - ] - )->allowedRoles()->sync([]); - - $this->pages->create( - [ - 'en' => [ - 'title' => 'Contact', - ], - 'tr' => [ - 'title' => 'Bize Ulaşın', - ], - 'slug' => 'contact', - 'entry' => $type->getEntryModel()->create( - [ - 'en' => [ - 'content' => '

Drop us a line! We\'d love to hear from you!


-

{{ form(\'contact\').to(\'example@domain.com\')|raw }}

', - ], - ] - ), - 'type' => $type, - 'enabled' => true, - 'theme_layout' => 'theme::layouts/default.twig', - ] - )->allowedRoles()->sync([]); - - - //Diğer Sayfalar - - $this->pages->create( - [ - 'en' => [ - 'title' => 'Secure e-Trade Tips', - ], - 'tr' => [ - 'title' => 'Güvenli Alışverişin İpuçları', - ], - 'slug' => 'secure_e-trade_tips', - 'type' => $type, - 'enabled' => false, - 'visible' => 0, - 'theme_layout' => 'theme::layouts/default.twig', - ] - )->allowedRoles()->sync([]); - - $this->pages->create( - [ - 'en' => [ - 'title' => 'Agreements and Rules', - ], - 'tr' => [ - 'title' => 'Sözleşmeler ve Kurallar', - ], - 'slug' => 'agreements_and_rules', - 'type' => $type, - 'enabled' => false, - 'visible' => 0, - 'theme_layout' => 'theme::layouts/default.twig', - ] - )->allowedRoles()->sync([]); - - $this->pages->create( - [ - 'en' => [ - 'title' => 'Membership Agreement', - ], - 'tr' => [ - 'title' => 'Üyelik Sözleşmesi', - ], - 'slug' => 'membership_agreement', - 'type' => $type, - 'enabled' => false, - 'visible' => 0, - 'theme_layout' => 'theme::layouts/default.twig', - ] - )->allowedRoles()->sync([]); - - $this->pages->create( - [ - 'en' => [ - 'title' => 'Terms of Use', - ], - 'tr' => [ - 'title' => 'Kullanım Koşulları', - ], - 'slug' => 'terms_of_use', - 'type' => $type, - 'enabled' => false, - 'visible' => 0, - 'theme_layout' => 'theme::layouts/default.twig', - ] - )->allowedRoles()->sync([]); - - $this->pages->create( - [ - 'en' => [ - 'title' => 'Site Map', - ], - 'tr' => [ - 'title' => 'Site Haritası', - ], - 'slug' => 'site_map', - 'type' => $type, - 'enabled' => false, - 'visible' => 0, - 'theme_layout' => 'theme::layouts/default.twig', - ] - )->allowedRoles()->sync([]); - - $this->pages->create( - [ - 'en' => [ - 'title' => 'Personal Data Protection', - ], - 'tr' => [ - 'title' => 'Kişisel Verilerin Korunması', - ], - 'slug' => 'personal_data_protection', - 'type' => $type, - 'enabled' => false, - 'visible' => 0, - 'theme_layout' => 'theme::layouts/default.twig', - ] - )->allowedRoles()->sync([]); - - $this->pages->create( - [ - 'en' => [ - 'title' => 'Help and Operation Guide', - ], - 'tr' => [ - 'title' => 'Yardım ve İşlem Rehberi', - ], - 'slug' => 'help_and_operation_guide', - 'type' => $type, - 'enabled' => false, - 'visible' => 0, - 'theme_layout' => 'theme::layouts/default.twig', - ] - )->allowedRoles()->sync([]); - - //Footer Link LinkModel::query()->forceDelete(); $repository = new EntryRepository();