mirror of
https://github.com/openclassify/openclassify.git
synced 2026-02-10 15:26:10 -06:00
database seeder was moved to demodata-extension
This commit is contained in:
parent
59dbba58fb
commit
fa20f5ce7a
50
database/seeders/WidgetSeeder.php
Normal file
50
database/seeders/WidgetSeeder.php
Normal file
@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
use Anomaly\ConfigurationModule\Configuration\Contract\ConfigurationRepositoryInterface;
|
||||
use Anomaly\DashboardModule\Dashboard\Contract\DashboardRepositoryInterface;
|
||||
use Anomaly\DashboardModule\Widget\Contract\WidgetRepositoryInterface;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class WidgetSeeder extends Seeder
|
||||
{
|
||||
protected $widgets;
|
||||
protected $dashboards;
|
||||
protected $configuration;
|
||||
public function __construct(
|
||||
WidgetRepositoryInterface $widgets,
|
||||
DashboardRepositoryInterface $dashboards,
|
||||
ConfigurationRepositoryInterface $configuration
|
||||
) {
|
||||
$this->widgets = $widgets;
|
||||
$this->dashboards = $dashboards;
|
||||
$this->configuration = $configuration;
|
||||
}
|
||||
public function run()
|
||||
{
|
||||
$this->widgets->truncate();
|
||||
|
||||
$dashboard = $this->dashboards->findBySlug('welcome');
|
||||
|
||||
$widget = $this->widgets
|
||||
->create(
|
||||
[
|
||||
'en' => [
|
||||
'title' => 'Recent News',
|
||||
'description' => 'Recent news'
|
||||
],
|
||||
'extension' => 'anomaly.extension.xml_feed_widget',
|
||||
'dashboard' => $dashboard,
|
||||
]
|
||||
);
|
||||
|
||||
$this->configuration->purge('anomaly.extension.xml_feed_widget');
|
||||
|
||||
$this->configuration->create(
|
||||
[
|
||||
'scope' => $widget->getId(),
|
||||
'key' => 'anomaly.extension.xml_feed_widget::url',
|
||||
'value' => 'https://openclassify.com/posts/rss.xml',
|
||||
]
|
||||
);
|
||||
}
|
||||
}
|
||||
24
database/seeders/settings.sql
Normal file
24
database/seeders/settings.sql
Normal file
@ -0,0 +1,24 @@
|
||||
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
|
||||
SET AUTOCOMMIT = 0;
|
||||
START TRANSACTION;
|
||||
SET time_zone = "+00:00";
|
||||
|
||||
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
|
||||
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
|
||||
/*!40101 SET NAMES utf8mb4 */;
|
||||
|
||||
|
||||
INSERT INTO `default_settings_settings` (`created_at`,`key`, `value`) VALUES
|
||||
('2019-07-15 06:48:46', 'streams::date_format', 'j F, Y'),
|
||||
('2019-07-15 06:48:46', 'streams::time_format', 'H:i'),
|
||||
('2019-07-15 06:48:46', 'streams::name', 'PHP Classifieds software'),
|
||||
('2019-07-15 06:48:46', 'streams::description', 'OpenClassify is modular and most advanced open source classified platform build with Laravel.Use it in real estate classifieds, auto, e-commerce and other ...'),
|
||||
('2019-07-15 06:48:46', 'streams::standard_theme', 'visiosoft.theme.base'),
|
||||
('2019-07-15 06:48:46', 'streams::admin_theme', 'visiosoft.theme.defaultadmin'),
|
||||
('2019-07-15 06:48:46', 'streams::enabled_locales', 'a:11:{i:0;s:2:\"en\";i:1;s:2:\"fa\";i:2;s:2:\"ar\";i:3;s:2:\"el\";i:4;s:2:\"es\";i:5;s:2:\"fr\";i:6;s:2:\"it\";i:7;s:2:\"nl\";i:8;s:2:\"pt\";i:9;s:2:\"ru\";i:10;s:2:\"tr\";}');
|
||||
COMMIT;
|
||||
|
||||
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
||||
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||
Loading…
Reference in New Issue
Block a user