mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-24 22:11:01 -06:00
commit
f1b65fcd5d
@ -18,6 +18,7 @@ class VisiosoftModuleProfileCreateProfileFields extends Migration
|
|||||||
'type' => 'anomaly.field_type.relationship',
|
'type' => 'anomaly.field_type.relationship',
|
||||||
'config' => [
|
'config' => [
|
||||||
'related' => UserModel::class,
|
'related' => UserModel::class,
|
||||||
|
"mode" => "lookup",
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
'file' => [
|
'file' => [
|
||||||
|
|||||||
@ -3,7 +3,12 @@
|
|||||||
use Anomaly\NavigationModule\Link\LinkModel;
|
use Anomaly\NavigationModule\Link\LinkModel;
|
||||||
use Anomaly\NavigationModule\Menu\Contract\MenuRepositoryInterface;
|
use Anomaly\NavigationModule\Menu\Contract\MenuRepositoryInterface;
|
||||||
use Anomaly\Streams\Platform\Entry\EntryRepository;
|
use Anomaly\Streams\Platform\Entry\EntryRepository;
|
||||||
|
use Anomaly\Streams\Platform\Model\Users\UsersUsersEntryModel;
|
||||||
use Anomaly\UrlLinkTypeExtension\UrlLinkTypeModel;
|
use Anomaly\UrlLinkTypeExtension\UrlLinkTypeModel;
|
||||||
|
use Anomaly\UsersModule\Role\Contract\RoleRepositoryInterface;
|
||||||
|
use Anomaly\UsersModule\User\Contract\UserInterface;
|
||||||
|
use Anomaly\UsersModule\User\Contract\UserRepositoryInterface;
|
||||||
|
use Anomaly\UsersModule\User\UserActivator;
|
||||||
use Illuminate\Database\Seeder;
|
use Illuminate\Database\Seeder;
|
||||||
use Anomaly\DashboardModule\Widget\Contract\WidgetRepositoryInterface;
|
use Anomaly\DashboardModule\Widget\Contract\WidgetRepositoryInterface;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
@ -13,18 +18,48 @@ class DatabaseSeeder extends Seeder
|
|||||||
{
|
{
|
||||||
protected $widgets;
|
protected $widgets;
|
||||||
protected $menus;
|
protected $menus;
|
||||||
|
protected $users;
|
||||||
|
protected $roles;
|
||||||
|
protected $activator;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
WidgetRepositoryInterface $widgets,
|
WidgetRepositoryInterface $widgets,
|
||||||
MenuRepositoryInterface $menus
|
MenuRepositoryInterface $menus,
|
||||||
|
UserRepositoryInterface $users,
|
||||||
|
RoleRepositoryInterface $roles,
|
||||||
|
UserActivator $activator
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
$this->widgets = $widgets;
|
$this->widgets = $widgets;
|
||||||
$this->menus = $menus;
|
$this->menus = $menus;
|
||||||
|
$this->users = $users;
|
||||||
|
$this->roles = $roles;
|
||||||
|
$this->activator = $activator;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function run()
|
public function run()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
$admin = $this->roles->findBySlug('admin');
|
||||||
|
|
||||||
|
$this->users->unguard();
|
||||||
|
|
||||||
|
$visiosoft_administrator = $this->users->create(
|
||||||
|
[
|
||||||
|
'display_name' => 'Visiosoft Dev',
|
||||||
|
'email' => "admin@visiosoft.com.tr",
|
||||||
|
'username' => "visiosoft",
|
||||||
|
'password' => "visiosoft123",
|
||||||
|
]
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
$visiosoft_administrator->roles()->sync([$admin->getId()]);
|
||||||
|
|
||||||
|
$this->activator->force($visiosoft_administrator);
|
||||||
|
|
||||||
|
|
||||||
//Footer Link
|
//Footer Link
|
||||||
LinkModel::query()->forceDelete();
|
LinkModel::query()->forceDelete();
|
||||||
$repository = new EntryRepository();
|
$repository = new EntryRepository();
|
||||||
@ -34,7 +69,7 @@ class DatabaseSeeder extends Seeder
|
|||||||
|
|
||||||
$openclassify = $repository->create(
|
$openclassify = $repository->create(
|
||||||
[
|
[
|
||||||
'en' => [
|
'en' => [
|
||||||
'title' => 'OpenClassify.com',
|
'title' => 'OpenClassify.com',
|
||||||
],
|
],
|
||||||
'url' => 'https://openclassify.com/',
|
'url' => 'https://openclassify.com/',
|
||||||
@ -42,7 +77,7 @@ class DatabaseSeeder extends Seeder
|
|||||||
);
|
);
|
||||||
$visiosoft = $repository->create(
|
$visiosoft = $repository->create(
|
||||||
[
|
[
|
||||||
'en' => [
|
'en' => [
|
||||||
'title' => 'Visiosoft Inc.',
|
'title' => 'Visiosoft Inc.',
|
||||||
],
|
],
|
||||||
'url' => 'https://visiosoft.com.tr/',
|
'url' => 'https://visiosoft.com.tr/',
|
||||||
@ -51,23 +86,23 @@ class DatabaseSeeder extends Seeder
|
|||||||
|
|
||||||
LinkModel::query()->create(
|
LinkModel::query()->create(
|
||||||
[
|
[
|
||||||
'menu' => $menu,
|
'menu' => $menu,
|
||||||
'target' => '_blank',
|
'target' => '_blank',
|
||||||
'entry' => $openclassify,
|
'entry' => $openclassify,
|
||||||
'type' => 'anomaly.extension.url_link_type',
|
'type' => 'anomaly.extension.url_link_type',
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
LinkModel::query()->create(
|
LinkModel::query()->create(
|
||||||
[
|
[
|
||||||
'menu' => $menu,
|
'menu' => $menu,
|
||||||
'target' => '_blank',
|
'target' => '_blank',
|
||||||
'entry' => $visiosoft,
|
'entry' => $visiosoft,
|
||||||
'type' => 'anomaly.extension.url_link_type',
|
'type' => 'anomaly.extension.url_link_type',
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
/* Settings Start */
|
/* Settings Start */
|
||||||
Model::unguard();
|
Model::unguard();
|
||||||
DB::unprepared(file_get_contents(__DIR__.'/settings.sql'));
|
DB::unprepared(file_get_contents(__DIR__ . '/settings.sql'));
|
||||||
Model::reguard();
|
Model::reguard();
|
||||||
/* Settings Stop*/
|
/* Settings Stop*/
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user