diff --git a/composer.json b/composer.json
index 6233f5f59..cb8906064 100644
--- a/composer.json
+++ b/composer.json
@@ -1,10 +1,16 @@
{
- "name": "anomaly/streams-platform",
+ "name": "visiosoft/streams-platform",
"description": "A powerful, inclusive, modular PHP application engine built lovingly for Laravel.",
"authors": [
{
"name": "Ryan Thompson",
- "email": "ryan@pyrocms.com"
+ "email": "ryan@pyrocms.com",
+ "role": "Owner"
+ },
+ {
+ "name": "Vedat Akdogan",
+ "email": "vedatakdogan@live.com",
+ "role": "Developer"
}
],
"require": {
@@ -21,11 +27,12 @@
"nicmart/string-template": "^0.1.3",
"symfony/yaml": "^6.1",
"jenssegers/agent": "^2.6.0",
- "barryvdh/laravel-httpcache": "^1.0",
+ "spektra2147/laravel-httpcache": "^1.0",
"asm89/twig-cache-extension": "^1.3.0",
"vstelmakh/url-highlight": "^2.3",
"ezyang/htmlpurifier": "~4.0",
- "tubalmartin/cssmin": "~4.0"
+ "tubalmartin/cssmin": "~4.0",
+ "scssphp/scssphp": "^1.11"
},
"autoload": {
"psr-4": {
diff --git a/docs/en/02.getting-started/04.configuration.md b/docs/en/02.getting-started/04.configuration.md
index fc15f3cf6..c6977a6e4 100644
--- a/docs/en/02.getting-started/04.configuration.md
+++ b/docs/en/02.getting-started/04.configuration.md
@@ -8,7 +8,7 @@ title: Configuration
## Introduction
-Streams configuration can be found in `vendor/anomaly/streams-platform/resources/config`. It is a good idea to look through the configuration files to get acquainted with what's available.
+Streams configuration can be found in `vendor/visiosoft/streams-platform/resources/config`. It is a good idea to look through the configuration files to get acquainted with what's available.
[Configuration Reference](../reference/configuration){.link}
@@ -40,11 +40,11 @@ This will copy all configuration to `resources/{application}/streams/config` so
### Settings and Preferences
-The [Settings](https://pyrocms.com/documentation/settings-module) and [Preferences](https://pyrocms.com/documentation/preferences-module) modules both `bind` values to configuration. This let's you manage much of the configuration for the Streams Platform via the control panel.
+The [Settings](https://pyrocms.com/documentation/settings-module) and [Preferences](https://pyrocms.com/documentation/preferences-module) modules both `bind` values to configuration. This let's you manage much of the configuration for the Streams Platform via the control panel.
You can see what settings are bound to what configuration by reviewing the settings and preferences configuration found within the following files:
```bash
-vendor/anomaly/streams-platform/resources/config/settings/settings.php
-vendor/anomaly/streams-platform/resources/config/preferences/preferences.php
+vendor/visiosoft/streams-platform/resources/config/settings/settings.php
+vendor/visiosoft/streams-platform/resources/config/preferences/preferences.php
```
diff --git a/docs/en/03.reference/02.hints.md b/docs/en/03.reference/02.hints.md
index 061dbe56a..b7575576c 100644
--- a/docs/en/03.reference/02.hints.md
+++ b/docs/en/03.reference/02.hints.md
@@ -65,7 +65,7 @@ The `storage::` path hint represents your application's storage directory `stora
### streams
-The `streams::` path hint represents the `resources` directory for the Streams Platform `vendor/anomaly/streams-platform/resources/`.
+The `streams::` path hint represents the `resources` directory for the Streams Platform `vendor/visiosoft/streams-platform/resources/`.
### module
@@ -126,7 +126,7 @@ The `storage::` path hint represents your application's storage directory `stora
### streams
-The `streams::` path hint represents the `resources` directory for the Streams Platform `vendor/anomaly/streams-platform/resources/`.
+The `streams::` path hint represents the `resources` directory for the Streams Platform `vendor/visiosoft/streams-platform/resources/`.
## Config Hints
@@ -143,11 +143,11 @@ config('streams::datetime.date_format');
### addons
-Every addon has a config path hint for the addon's `config` directory `{addon_path}/resources/config/` which looks like `anomaly.module.documentation::`.
+Every addon has a config path hint for the addon's `config` directory `{addon_path}/resources/config/` which looks like `anomaly.module.documentation::`.
### streams
-The `streams::` path hint represents the `config` directory for the Streams Platform `vendor/anomaly/streams-platform/resources/config/`.
+The `streams::` path hint represents the `config` directory for the Streams Platform `vendor/visiosoft/streams-platform/resources/config/`.
## Translator Hints
@@ -164,7 +164,7 @@ trans('streams::distribution.name');
### addons
-Every addon has a config path hint for the addon's `lang` directory `{addon_path}/resources/lang/` which looks like `anomaly.module.documentation::`.
+Every addon has a config path hint for the addon's `lang` directory `{addon_path}/resources/lang/` which looks like `anomaly.module.documentation::`.
### module
@@ -176,7 +176,7 @@ The `theme::` path hint represents the `lang` directory for the `active` theme `
### streams
-The `streams::` path hint represents the `lang` directory for the Streams Platform `vendor/anomaly/streams-platform/resources/lang/`.
+The `streams::` path hint represents the `lang` directory for the Streams Platform `vendor/visiosoft/streams-platform/resources/lang/`.
## View Hints
@@ -193,7 +193,7 @@ view('streams::form.form');
### addons
-Every addon has a path hint for the addon's `view` directory `{addon_path}/resources/views/` which looks like `anomaly.module.documentation::`.
+Every addon has a path hint for the addon's `view` directory `{addon_path}/resources/views/` which looks like `anomaly.module.documentation::`.
### module
@@ -205,7 +205,7 @@ The `theme::` path hint represents the `views` directory for the `active` theme
### streams
-The `streams::` path hint represents the `views` directory for the Streams Platform `vendor/anomaly/streams-platform/resources/views/`.
+The `streams::` path hint represents the `views` directory for the Streams Platform `vendor/visiosoft/streams-platform/resources/views/`.
### app
diff --git a/docs/en/05.core-concepts/04.image.md b/docs/en/05.core-concepts/04.image.md
index 89d736602..c83ea1b34 100644
--- a/docs/en/05.core-concepts/04.image.md
+++ b/docs/en/05.core-concepts/04.image.md
@@ -105,7 +105,7 @@ All paths are relative to your application's base path.
* `asset`: public/app/{app_reference}/
* `storage`: storage/streams/{app_reference}/
* `download`: public/app/{app_reference}/assets/downloads/
-* `streams`: vendor/anomaly/streams-platform/resources/
+* `streams`: vendor/visiosoft/streams-platform/resources/
* `bower`: bin/bower_components/
* `theme`: {active_theme_path}/resources/
* `module`: {active_module_path}/resources/
@@ -1488,7 +1488,7 @@ The name of the macro to run.
.macro("thumb")
.macro("desaturate")
.macro("responsive")|raw }}
-
+
### Image::base64()
The `base64` method returns the base64 encoded data of the image.
@@ -1496,7 +1496,7 @@ The `base64` method returns the base64 encoded data of the image.
#### Returns: `string`
#### Example
$base64 = $image->base64(); // data:image/png;base64,iVBORw0KGgoAAAANSU...
-
+
#### Twig
diff --git a/resources/config/settings/sections.php b/resources/config/settings/sections.php
index 3a47a0591..237afa272 100644
--- a/resources/config/settings/sections.php
+++ b/resources/config/settings/sections.php
@@ -50,6 +50,7 @@
'mail_port',
'mail_username',
'mail_password',
+ 'mail_encrypt',
],
],
'cache' => [
diff --git a/resources/config/settings/settings.php b/resources/config/settings/settings.php
index 5a23ea618..34bd1a5f9 100644
--- a/resources/config/settings/settings.php
+++ b/resources/config/settings/settings.php
@@ -266,6 +266,14 @@
'type' => 'password',
],
],
+ 'mail_encrypt' => [
+ 'env' => 'MAIL_ENCRYPTION',
+ 'bind' => 'mail.encryption',
+ 'type' => 'anomaly.field_type.text',
+ 'config' => [
+ 'default_value' => 'ssl',
+ ],
+ ],
'http_cache' => [
'env' => 'HTTP_CACHE',
'bind' => 'streams::httpcache.enabled',
diff --git a/resources/lang/en/setting.php b/resources/lang/en/setting.php
index bc18d8669..188b175e0 100644
--- a/resources/lang/en/setting.php
+++ b/resources/lang/en/setting.php
@@ -134,6 +134,10 @@
'label' => 'SMTP Password',
'instructions' => 'Specify the SMTP password to use.',
],
+ 'mail_encrypt' => [
+ 'label' => 'SMTP Encryption',
+ 'instructions' => 'Specify the SMTP encryption to use.',
+ ],
'http_cache' => [
'label' => 'HTTP Cache',
'instructions' => 'Do you want to enable HTTP cache?',
diff --git a/resources/lang/tr/setting.php b/resources/lang/tr/setting.php
index b80a6c1f5..9a72bb5a4 100644
--- a/resources/lang/tr/setting.php
+++ b/resources/lang/tr/setting.php
@@ -134,6 +134,10 @@
'label' => 'SMTP Şifresi',
'instructions' => 'Kullanılacak SMTP şifresini belirtin.',
],
+ 'mail_encrypt' => [
+ 'label' => 'SMTP Şifreleme',
+ 'instructions' => 'Kullanılacak SMTP şifreleme yöntemini belirtin.',
+ ],
'http_cache' => [
'label' => 'HTTP Önbelleği',
'instructions' => 'HTTP önbelleğini etkinleştirmek istiyor musunuz?',
diff --git a/src/Addon/Addon.php b/src/Addon/Addon.php
index f060a22a8..2d38ce47d 100644
--- a/src/Addon/Addon.php
+++ b/src/Addon/Addon.php
@@ -164,7 +164,7 @@ public function isShared()
*/
public function isTesting()
{
- return Str::contains($this->getPath(), 'vendor/anomaly/streams-platform/addons/' . $this->getVendor());
+ return Str::contains($this->getPath(), 'vendor/visiosoft/streams-platform/addons/' . $this->getVendor());
}
/**
diff --git a/src/Addon/AddonIntegrator.php b/src/Addon/AddonIntegrator.php
index 2783409c9..fc84d1613 100644
--- a/src/Addon/AddonIntegrator.php
+++ b/src/Addon/AddonIntegrator.php
@@ -1,5 +1,6 @@
views = $views;
- $this->provider = $provider;
- $this->container = $container;
- $this->collection = $collection;
- $this->application = $application;
+ )
+ {
+ $this->views = $views;
+ $this->provider = $provider;
+ $this->container = $container;
+ $this->collection = $collection;
+ $this->application = $application;
$this->configurator = $configurator;
}
@@ -112,11 +114,23 @@ public function register($path, $namespace, $enabled, $installed)
$slug
) . studly_case($type);
- /* @var Addon|Module|Extension|Twig_ExtensionInterface $addon */
if (!class_exists($class)) {
- return null;
+
+ $namespace = dispatch_sync(new GetNamespaceWithComposer($path));
+
+ list($vendor, $type, $slug) = explode('.', $namespace);
+
+ $class = studly_case($vendor) . '\\' . studly_case($slug) . studly_case($type) . '\\' . studly_case(
+ $slug
+ ) . studly_case($type);
+
+ if (!class_exists($class)) {
+ return null;
+ }
}
+
+
$addon = app($class)
->setPath($path)
->setType($type)
diff --git a/src/Addon/AddonManager.php b/src/Addon/AddonManager.php
index 81c353c25..e96f94fdc 100644
--- a/src/Addon/AddonManager.php
+++ b/src/Addon/AddonManager.php
@@ -2,6 +2,7 @@
namespace Anomaly\Streams\Platform\Addon;
+use Anomaly\Streams\Platform\Addon\Command\GetNamespaceWithComposer;
use Illuminate\Support\Str;
use Illuminate\Support\Facades\Request;
use Illuminate\Contracts\Container\Container;
@@ -80,22 +81,23 @@ class AddonManager
* @param AddonCollection $addons
*/
public function __construct(
- AddonPaths $paths,
- AddonLoader $loader,
- ModuleModel $modules,
- Container $container,
- ExtensionModel $extensions,
+ AddonPaths $paths,
+ AddonLoader $loader,
+ ModuleModel $modules,
+ Container $container,
+ ExtensionModel $extensions,
AddonIntegrator $integrator,
AddonCollection $addons
- ) {
- $this->paths = $paths;
- $this->addons = $addons;
- $this->loader = $loader;
- $this->modules = $modules;
- $this->container = $container;
+ )
+ {
+ $this->paths = $paths;
+ $this->addons = $addons;
+ $this->loader = $loader;
+ $this->modules = $modules;
+ $this->container = $container;
$this->integrator = $integrator;
$this->extensions = $extensions;
- $this->loader = $loader;
+ $this->loader = $loader;
}
/**
@@ -105,7 +107,7 @@ public function __construct(
*/
public function register($reload = false)
{
- $enabled = $this->getEnabledAddonNamespaces();
+ $enabled = $this->getEnabledAddonNamespaces();
$installed = $this->getInstalledAddonNamespaces();
$this->container->bind(
@@ -155,7 +157,7 @@ function () use ($installed) {
$this->loader->classLoader()->addPsr4(
'Anomaly\\StreamsPlatformTests\\',
- base_path('vendor/anomaly/streams-platform/tests')
+ base_path('vendor/visiosoft/streams-platform/tests')
);
$this->loader->register();
@@ -200,7 +202,11 @@ function () use ($installed) {
}
// Sort all addons.
- $this->addons = $this->addons->sort();
+ /**
+ * Commented because of the sort problem of modules
+ */
+ // $this->addons = $this->addons->sort();
+
/*
* Disperse addons to their
@@ -316,6 +322,28 @@ protected function getAddonNamespace($path)
$slug = strtolower(substr(basename($path), 0, strpos(basename($path), '-')));
$type = strtolower(substr(basename($path), strpos(basename($path), '-') + 1));
- return "{$vendor}.{$type}.{$slug}";
+ $namespace = "{$vendor}.{$type}.{$slug}";
+
+ list($vendor, $type, $slug) = explode('.', $namespace);
+
+ $class = studly_case($vendor) . '\\' . studly_case($slug) . studly_case($type) . '\\' . studly_case(
+ $slug
+ ) . studly_case($type);
+
+ if (!class_exists($class)) {
+ $composer_namespace = dispatch_sync(new GetNamespaceWithComposer($path));
+
+ list($vendor, $type, $slug) = explode('.', $composer_namespace);
+
+ $class = studly_case($vendor) . '\\' . studly_case($slug) . studly_case($type) . '\\' . studly_case(
+ $slug
+ ) . studly_case($type);
+
+ if (class_exists($class)) {
+ return $composer_namespace;
+ }
+ }
+
+ return $namespace;
}
}
diff --git a/src/Addon/AddonPaths.php b/src/Addon/AddonPaths.php
index c2d3ce759..de7be9333 100644
--- a/src/Addon/AddonPaths.php
+++ b/src/Addon/AddonPaths.php
@@ -127,16 +127,16 @@ public function native()
if (!is_dir($path)) {
return false;
}
-
+
$paths = [];
foreach (config('streams::addons.types') as $type) {
$paths = array_merge($paths, glob("{$path}/*/*-{$type}", GLOB_ONLYDIR));
}
-
+
return $paths;
}
-
+
/**
* Return all core addon paths in a given folder.
*
@@ -211,7 +211,7 @@ public function application()
*/
public function testing()
{
- $path = base_path('vendor/anomaly/streams-platform/addons');
+ $path = base_path('vendor/visiosoft/streams-platform/addons');
if (env('APP_ENV') !== 'testing') {
return false;
diff --git a/src/Addon/Command/GetNamespaceWithComposer.php b/src/Addon/Command/GetNamespaceWithComposer.php
new file mode 100644
index 000000000..0067d1bcf
--- /dev/null
+++ b/src/Addon/Command/GetNamespaceWithComposer.php
@@ -0,0 +1,36 @@
+path = $path;
+ }
+
+ public function handle()
+ {
+ $path = $this->path;
+
+ if (!file_exists($path . '/composer.json')) {
+ return null;
+ }
+
+ if (!$composer = json_decode(file_get_contents($path . '/composer.json'), true)) {
+ return null;
+ }
+
+ foreach (array_get($composer['autoload'], 'psr-4', []) as $namespace => $autoload) {
+ break;
+ }
+
+ $vendor = strtolower(array_first(explode('\\', $namespace)));
+ $slug = strtolower(substr(basename($path), 0, strpos(basename($path), '-')));
+ $type = strtolower(substr(basename($path), strpos(basename($path), '-') + 1));
+
+ return "{$vendor}.{$type}.{$slug}";
+ }
+}
diff --git a/src/Addon/Console/Command/ScaffoldTheme.php b/src/Addon/Console/Command/ScaffoldTheme.php
index 3d44182c2..5788cfc1d 100644
--- a/src/Addon/Console/Command/ScaffoldTheme.php
+++ b/src/Addon/Console/Command/ScaffoldTheme.php
@@ -53,7 +53,7 @@ public function handle(Filesystem $filesystem)
{
foreach ($this->copy as $copy) {
$filesystem->copyDirectory(
- base_path('vendor/anomaly/streams-platform/resources/stubs/addons/resources/' . $copy),
+ base_path('vendor/visiosoft/streams-platform/resources/stubs/addons/resources/' . $copy),
"{$this->path}/resources/" . $copy
);
}
diff --git a/src/Addon/Console/Command/WriteAddonButtonLang.php b/src/Addon/Console/Command/WriteAddonButtonLang.php
index 284907b36..7f10f23bb 100644
--- a/src/Addon/Console/Command/WriteAddonButtonLang.php
+++ b/src/Addon/Console/Command/WriteAddonButtonLang.php
@@ -43,7 +43,7 @@ public function handle(Parser $parser, Filesystem $filesystem)
$path = "{$this->path}/resources/lang/en/button.php";
$template = $filesystem->get(
- base_path('vendor/anomaly/streams-platform/resources/stubs/addons/resources/lang/en/button.stub')
+ base_path('vendor/visiosoft/streams-platform/resources/stubs/addons/resources/lang/en/button.stub')
);
$filesystem->makeDirectory(dirname($path), 0755, true, true);
diff --git a/src/Addon/Console/Command/WriteAddonClass.php b/src/Addon/Console/Command/WriteAddonClass.php
index 7e47e4d23..3feb56387 100644
--- a/src/Addon/Console/Command/WriteAddonClass.php
+++ b/src/Addon/Console/Command/WriteAddonClass.php
@@ -75,7 +75,7 @@ public function handle(Parser $parser, Filesystem $filesystem)
$path = "{$this->path}/src/{$addon}.php";
$template = $filesystem->get(
- base_path("vendor/anomaly/streams-platform/resources/stubs/addons/{$this->type}.stub")
+ base_path("vendor/visiosoft/streams-platform/resources/stubs/addons/{$this->type}.stub")
);
$filesystem->makeDirectory(dirname($path), 0755, true, true);
diff --git a/src/Addon/Console/Command/WriteAddonComposer.php b/src/Addon/Console/Command/WriteAddonComposer.php
index e212857bc..ed2b20455 100644
--- a/src/Addon/Console/Command/WriteAddonComposer.php
+++ b/src/Addon/Console/Command/WriteAddonComposer.php
@@ -75,7 +75,7 @@ public function handle(Parser $parser, Filesystem $filesystem)
$prefix = ucfirst(camel_case($vendor)) . '\\\\' . $addon . '\\\\';
$template = $filesystem->get(
- base_path('vendor/anomaly/streams-platform/resources/stubs/addons/composer.stub')
+ base_path('vendor/visiosoft/streams-platform/resources/stubs/addons/composer.stub')
);
$filesystem->makeDirectory(dirname($path), 0755, true, true);
diff --git a/src/Addon/Console/Command/WriteAddonFeatureTest.php b/src/Addon/Console/Command/WriteAddonFeatureTest.php
index 5c3b433be..b42353481 100644
--- a/src/Addon/Console/Command/WriteAddonFeatureTest.php
+++ b/src/Addon/Console/Command/WriteAddonFeatureTest.php
@@ -78,7 +78,7 @@ public function handle(Parser $parser, Filesystem $filesystem)
$path = "{$this->path}/tests/Feature/{$addon}Test.php";
$template = $filesystem->get(
- base_path("vendor/anomaly/streams-platform/resources/stubs/addons/tests/feature.stub")
+ base_path("vendor/visiosoft/streams-platform/resources/stubs/addons/tests/feature.stub")
);
$filesystem->makeDirectory(dirname($path), 0755, true, true);
diff --git a/src/Addon/Console/Command/WriteAddonFieldLang.php b/src/Addon/Console/Command/WriteAddonFieldLang.php
index 19436a23a..e937d7f36 100644
--- a/src/Addon/Console/Command/WriteAddonFieldLang.php
+++ b/src/Addon/Console/Command/WriteAddonFieldLang.php
@@ -43,7 +43,7 @@ public function handle(Parser $parser, Filesystem $filesystem)
$path = "{$this->path}/resources/lang/en/field.php";
$template = $filesystem->get(
- base_path('vendor/anomaly/streams-platform/resources/stubs/addons/resources/lang/en/field.stub')
+ base_path('vendor/visiosoft/streams-platform/resources/stubs/addons/resources/lang/en/field.stub')
);
$filesystem->makeDirectory(dirname($path), 0755, true, true);
diff --git a/src/Addon/Console/Command/WriteAddonGitIgnore.php b/src/Addon/Console/Command/WriteAddonGitIgnore.php
index 59412274c..2f1d80fce 100644
--- a/src/Addon/Console/Command/WriteAddonGitIgnore.php
+++ b/src/Addon/Console/Command/WriteAddonGitIgnore.php
@@ -68,7 +68,7 @@ public function handle(Parser $parser, Filesystem $filesystem)
$path = "{$this->path}/.gitignore";
$template = $filesystem->get(
- base_path('vendor/anomaly/streams-platform/resources/stubs/addons/gitignore.stub')
+ base_path('vendor/visiosoft/streams-platform/resources/stubs/addons/gitignore.stub')
);
$filesystem->makeDirectory(dirname($path), 0755, true, true);
diff --git a/src/Addon/Console/Command/WriteAddonLang.php b/src/Addon/Console/Command/WriteAddonLang.php
index 446a5bd1a..e2f148f0a 100644
--- a/src/Addon/Console/Command/WriteAddonLang.php
+++ b/src/Addon/Console/Command/WriteAddonLang.php
@@ -62,7 +62,7 @@ public function handle(Parser $parser, Filesystem $filesystem)
$type = ucwords(str_replace('_', ' ', $this->type));
$template = $filesystem->get(
- base_path('vendor/anomaly/streams-platform/resources/stubs/addons/resources/lang/en/addon.stub')
+ base_path('vendor/visiosoft/streams-platform/resources/stubs/addons/resources/lang/en/addon.stub')
);
$filesystem->makeDirectory(dirname($path), 0755, true, true);
diff --git a/src/Addon/Console/Command/WriteAddonPackage.php b/src/Addon/Console/Command/WriteAddonPackage.php
index 8616cce4d..276b29e7c 100644
--- a/src/Addon/Console/Command/WriteAddonPackage.php
+++ b/src/Addon/Console/Command/WriteAddonPackage.php
@@ -44,7 +44,7 @@ public function handle(Parser $parser, Filesystem $filesystem)
$path = "{$this->path}/package.json";
$template = $filesystem->get(
- base_path('vendor/anomaly/streams-platform/resources/stubs/addons/package.addon.stub')
+ base_path('vendor/visiosoft/streams-platform/resources/stubs/addons/package.addon.stub')
);
$filesystem->makeDirectory(dirname($path), 0755, true, true);
diff --git a/src/Addon/Console/Command/WriteAddonPermissionLang.php b/src/Addon/Console/Command/WriteAddonPermissionLang.php
index b48dcb1cf..5b458f1e8 100644
--- a/src/Addon/Console/Command/WriteAddonPermissionLang.php
+++ b/src/Addon/Console/Command/WriteAddonPermissionLang.php
@@ -43,7 +43,7 @@ public function handle(Parser $parser, Filesystem $filesystem)
$path = "{$this->path}/resources/lang/en/permission.php";
$template = $filesystem->get(
- base_path('vendor/anomaly/streams-platform/resources/stubs/addons/resources/lang/en/permission.stub')
+ base_path('vendor/visiosoft/streams-platform/resources/stubs/addons/resources/lang/en/permission.stub')
);
$filesystem->makeDirectory(dirname($path), 0755, true, true);
diff --git a/src/Addon/Console/Command/WriteAddonPermissions.php b/src/Addon/Console/Command/WriteAddonPermissions.php
index 45d1f570a..adb641b94 100644
--- a/src/Addon/Console/Command/WriteAddonPermissions.php
+++ b/src/Addon/Console/Command/WriteAddonPermissions.php
@@ -43,7 +43,7 @@ public function handle(Parser $parser, Filesystem $filesystem)
$path = "{$this->path}/resources/config/permissions.php";
$template = $filesystem->get(
- base_path('vendor/anomaly/streams-platform/resources/stubs/addons/resources/config/permissions.stub')
+ base_path('vendor/visiosoft/streams-platform/resources/stubs/addons/resources/config/permissions.stub')
);
$filesystem->makeDirectory(dirname($path), 0755, true, true);
diff --git a/src/Addon/Console/Command/WriteAddonPhpUnit.php b/src/Addon/Console/Command/WriteAddonPhpUnit.php
index 8a340e67d..923550749 100644
--- a/src/Addon/Console/Command/WriteAddonPhpUnit.php
+++ b/src/Addon/Console/Command/WriteAddonPhpUnit.php
@@ -68,7 +68,7 @@ public function handle(Parser $parser, Filesystem $filesystem)
$path = "{$this->path}/phpunit.xml";
$template = $filesystem->get(
- base_path('vendor/anomaly/streams-platform/resources/stubs/addons/phpunit.stub')
+ base_path('vendor/visiosoft/streams-platform/resources/stubs/addons/phpunit.stub')
);
$filesystem->makeDirectory(dirname($path), 0755, true, true);
diff --git a/src/Addon/Console/Command/WriteAddonSectionLang.php b/src/Addon/Console/Command/WriteAddonSectionLang.php
index 9f313bbcf..685fcd504 100644
--- a/src/Addon/Console/Command/WriteAddonSectionLang.php
+++ b/src/Addon/Console/Command/WriteAddonSectionLang.php
@@ -43,7 +43,7 @@ public function handle(Parser $parser, Filesystem $filesystem)
$path = "{$this->path}/resources/lang/en/section.php";
$template = $filesystem->get(
- base_path('vendor/anomaly/streams-platform/resources/stubs/addons/resources/lang/en/section.stub')
+ base_path('vendor/visiosoft/streams-platform/resources/stubs/addons/resources/lang/en/section.stub')
);
$filesystem->makeDirectory(dirname($path), 0755, true, true);
diff --git a/src/Addon/Console/Command/WriteAddonServiceProvider.php b/src/Addon/Console/Command/WriteAddonServiceProvider.php
index b4f3481d4..3a0251a28 100644
--- a/src/Addon/Console/Command/WriteAddonServiceProvider.php
+++ b/src/Addon/Console/Command/WriteAddonServiceProvider.php
@@ -76,7 +76,7 @@ public function handle(Parser $parser, Filesystem $filesystem)
$path = "{$this->path}/src/{$provider}.php";
$template = $filesystem->get(
- base_path('vendor/anomaly/streams-platform/resources/stubs/addons/provider.stub')
+ base_path('vendor/visiosoft/streams-platform/resources/stubs/addons/provider.stub')
);
$filesystem->makeDirectory(dirname($path), 0755, true, true);
diff --git a/src/Addon/Console/Command/WriteAddonStreamLang.php b/src/Addon/Console/Command/WriteAddonStreamLang.php
index 042733106..cf314e82e 100644
--- a/src/Addon/Console/Command/WriteAddonStreamLang.php
+++ b/src/Addon/Console/Command/WriteAddonStreamLang.php
@@ -43,7 +43,7 @@ public function handle(Parser $parser, Filesystem $filesystem)
$path = "{$this->path}/resources/lang/en/stream.php";
$template = $filesystem->get(
- base_path('vendor/anomaly/streams-platform/resources/stubs/addons/resources/lang/en/stream.stub')
+ base_path('vendor/visiosoft/streams-platform/resources/stubs/addons/resources/lang/en/stream.stub')
);
$filesystem->makeDirectory(dirname($path), 0755, true, true);
diff --git a/src/Addon/Console/Command/WriteAddonTestCase.php b/src/Addon/Console/Command/WriteAddonTestCase.php
index 3595d24db..3dcac03e6 100644
--- a/src/Addon/Console/Command/WriteAddonTestCase.php
+++ b/src/Addon/Console/Command/WriteAddonTestCase.php
@@ -76,7 +76,7 @@ public function handle(Parser $parser, Filesystem $filesystem)
$path = "{$this->path}/tests/{$addon}TestCase.php";
$template = $filesystem->get(
- base_path("vendor/anomaly/streams-platform/resources/stubs/addons/tests/test.stub")
+ base_path("vendor/visiosoft/streams-platform/resources/stubs/addons/tests/test.stub")
);
$filesystem->makeDirectory(dirname($path), 0755, true, true);
diff --git a/src/Addon/Console/Command/WriteAddonWebpack.php b/src/Addon/Console/Command/WriteAddonWebpack.php
index a20766e88..625628bea 100644
--- a/src/Addon/Console/Command/WriteAddonWebpack.php
+++ b/src/Addon/Console/Command/WriteAddonWebpack.php
@@ -44,7 +44,7 @@ public function handle(Parser $parser, Filesystem $filesystem)
$path = "{$this->path}/webpack.mix.js";
$template = $filesystem->get(
- base_path('vendor/anomaly/streams-platform/resources/stubs/addons/webpack.addon.stub')
+ base_path('vendor/visiosoft/streams-platform/resources/stubs/addons/webpack.addon.stub')
);
$filesystem->makeDirectory(dirname($path), 0755, true, true);
diff --git a/src/Addon/Console/Command/WriteThemePackage.php b/src/Addon/Console/Command/WriteThemePackage.php
index 9b779a20d..2b94b58aa 100644
--- a/src/Addon/Console/Command/WriteThemePackage.php
+++ b/src/Addon/Console/Command/WriteThemePackage.php
@@ -44,7 +44,7 @@ public function handle(Parser $parser, Filesystem $filesystem)
$path = "{$this->path}/package.json";
$template = $filesystem->get(
- base_path('vendor/anomaly/streams-platform/resources/stubs/addons/package.theme.stub')
+ base_path('vendor/visiosoft/streams-platform/resources/stubs/addons/package.theme.stub')
);
$filesystem->makeDirectory(dirname($path), 0755, true, true);
diff --git a/src/Addon/Console/Command/WriteThemeWebpack.php b/src/Addon/Console/Command/WriteThemeWebpack.php
index f25683db2..246406993 100644
--- a/src/Addon/Console/Command/WriteThemeWebpack.php
+++ b/src/Addon/Console/Command/WriteThemeWebpack.php
@@ -44,7 +44,7 @@ public function handle(Parser $parser, Filesystem $filesystem)
$path = "{$this->path}/webpack.mix.js";
$template = $filesystem->get(
- base_path('vendor/anomaly/streams-platform/resources/stubs/addons/webpack.theme.stub')
+ base_path('vendor/visiosoft/streams-platform/resources/stubs/addons/webpack.theme.stub')
);
$filesystem->makeDirectory(dirname($path), 0755, true, true);
diff --git a/src/Artisan/ArtisanServiceProvider.php b/src/Artisan/ArtisanServiceProvider.php
index 61308166c..10c654aef 100644
--- a/src/Artisan/ArtisanServiceProvider.php
+++ b/src/Artisan/ArtisanServiceProvider.php
@@ -57,6 +57,9 @@ class ArtisanServiceProvider extends \Illuminate\Foundation\Providers\ArtisanSer
\Anomaly\Streams\Platform\Application\Console\Refresh::class,
\Anomaly\Streams\Platform\Application\Console\AppPublish::class,
\Anomaly\Streams\Platform\Application\Console\StreamsPublish::class,
+
+ // Fix Seed Command
+ \Anomaly\Streams\Platform\Database\Seeder\Console\SeedCommand::class
];
/**
diff --git a/src/Asset/Filter/RubySassFilter.php b/src/Asset/Filter/RubySassFilter.php
index c5be64377..d50ce31f8 100644
--- a/src/Asset/Filter/RubySassFilter.php
+++ b/src/Asset/Filter/RubySassFilter.php
@@ -4,7 +4,7 @@
use Assetic\Asset\AssetInterface;
use Assetic\Filter\Sass\SassFilter;
use Illuminate\Foundation\Bus\DispatchesJobs;
-use Leafo\ScssPhp\Compiler;
+use ScssPhp\ScssPhp\Compiler;
/**
* Class RubySassFilter
diff --git a/src/Asset/Filter/RubyScssFilter.php b/src/Asset/Filter/RubyScssFilter.php
index e26a7098f..baab956c5 100644
--- a/src/Asset/Filter/RubyScssFilter.php
+++ b/src/Asset/Filter/RubyScssFilter.php
@@ -4,7 +4,7 @@
use Assetic\Asset\AssetInterface;
use Assetic\Filter\Sass\ScssFilter;
use Illuminate\Foundation\Bus\DispatchesJobs;
-use Leafo\ScssPhp\Compiler;
+use ScssPhp\ScssPhp\Compiler;
/**
* Class RubyScssFilter
diff --git a/src/Asset/Filter/SassFilter.php b/src/Asset/Filter/SassFilter.php
index 80818fc09..e2105b241 100644
--- a/src/Asset/Filter/SassFilter.php
+++ b/src/Asset/Filter/SassFilter.php
@@ -4,7 +4,7 @@
use Assetic\Asset\AssetInterface;
use Assetic\Filter\SassphpFilter;
use Illuminate\Foundation\Bus\DispatchesJobs;
-use Leafo\ScssPhp\Compiler;
+use ScssPhp\ScssPhp\Compiler;
/**
* Class SassFilter
diff --git a/src/Asset/Filter/ScssFilter.php b/src/Asset/Filter/ScssFilter.php
index a7c1a0cc6..5b78c842d 100644
--- a/src/Asset/Filter/ScssFilter.php
+++ b/src/Asset/Filter/ScssFilter.php
@@ -4,7 +4,7 @@
use Assetic\Asset\AssetInterface;
use Assetic\Filter\ScssphpFilter;
use Illuminate\Foundation\Bus\DispatchesJobs;
-use Leafo\ScssPhp\Compiler;
+use ScssPhp\ScssPhp\Compiler;
/**
* Class ScssFilter
diff --git a/src/Database/Migration/Console/Command/MigrateStreams.php b/src/Database/Migration/Console/Command/MigrateStreams.php
index 9dd71d00e..1754cb79b 100644
--- a/src/Database/Migration/Console/Command/MigrateStreams.php
+++ b/src/Database/Migration/Console/Command/MigrateStreams.php
@@ -22,8 +22,8 @@ class MigrateStreams
* @var array
*/
protected $paths = [
- 'vendor/anomaly/streams-platform/migrations/core',
- 'vendor/anomaly/streams-platform/migrations/application',
+ 'vendor/visiosoft/streams-platform/migrations/core',
+ 'vendor/visiosoft/streams-platform/migrations/application',
];
/**
diff --git a/src/Database/Migration/MigrationRepository.php b/src/Database/Migration/MigrationRepository.php
index cf012e1f2..afbc10b76 100644
--- a/src/Database/Migration/MigrationRepository.php
+++ b/src/Database/Migration/MigrationRepository.php
@@ -49,4 +49,15 @@ public function setMigrator(Migrator $migrator)
return $this;
}
+
+ /**
+ * Remove a migration from the log.
+ *
+ * @param object $migration
+ * @return void
+ */
+ public function delete($migration)
+ {
+ $this->table()->where('migration','LIKE', '%'.$migration->getAddon()->getNamespace().'%')->delete();
+ }
}
diff --git a/src/Database/Migration/MigrationServiceProvider.php b/src/Database/Migration/MigrationServiceProvider.php
index 796fe65f6..fe49942a0 100644
--- a/src/Database/Migration/MigrationServiceProvider.php
+++ b/src/Database/Migration/MigrationServiceProvider.php
@@ -1,36 +1,56 @@
-
- * @author Ryan Thompson
- */
class MigrationServiceProvider extends \Illuminate\Database\MigrationServiceProvider
{
+ /**
+ * The commands to be registered.
+ *
+ * @var array
+ */
protected $commands = [
- 'Migrate' => 'command.migrate',
+ 'Migrate' => MigrateCommand::class,
'MigrateFresh' => FreshCommand::class,
'MigrateInstall' => InstallCommand::class,
- 'MigrateRefresh' => 'command.migrate.refresh',
- 'MigrateReset' => 'command.migrate.reset',
- 'MigrateRollback' => 'command.migrate.rollback',
+ 'MigrateRefresh' => RefreshCommand::class,
+ 'MigrateReset' => ResetCommand::class,
+ 'MigrateRollback' => RollbackCommand::class,
'MigrateStatus' => StatusCommand::class,
- 'MigrateMake' => 'command.migrate.make',
+ 'MigrateMake' => MigrateMakeCommand::class,
];
+ /**
+ * Register the service provider.
+ *
+ * @return void
+ */
+ public function register()
+ {
+ $this->registerRepository();
+
+ $this->registerMigrator();
+
+ $this->registerCreator();
+
+ $this->registerCommands($this->commands);
+ }
+
/**
* Register the migration repository service.
+ *
+ * @return void
*/
protected function registerRepository()
{
@@ -65,101 +85,140 @@ function ($app) {
}
/**
- * Register the "make" migration command.
+ * Register the migration creator.
*
* @return void
*/
- protected function registerMigrateMakeCommand()
+ protected function registerCreator()
{
- $this->registerCreator();
-
- $this->app->singleton(
- 'command.migrate.make',
- function ($app) {
+ $this->app->singleton('migration.creator', function ($app) {
+ return new MigrationCreator($app['files'], $app->basePath('stubs'));
+ });
+ }
- // Once we have the migration creator registered, we will create the command
- // and inject the creator. The creator is responsible for the actual file
- // creation of the migrations, and may be extended by these developers.
- $creator = $app['migration.creator'];
- $composer = $app['composer'];
+ /**
+ * Register the given commands.
+ *
+ * @param array $commands
+ * @return void
+ */
+ protected function registerCommands(array $commands)
+ {
+ foreach (array_keys($commands) as $command) {
+ $this->{"register{$command}Command"}();
+ }
- return new MigrateMakeCommand($creator, $composer);
- }
- );
+ $this->commands(array_values($commands));
}
/**
- * Register the "migrate" migration command.
+ * Register the command.
*
* @return void
*/
protected function registerMigrateCommand()
{
- $this->app->singleton(
- 'command.migrate',
- function ($app) {
- return new MigrateCommand($app['migrator'], $app['events']);
- }
- );
+ $this->app->singleton(MigrateCommand::class, function ($app) {
+ return new MigrateCommand($app['migrator'], $app[Dispatcher::class]);
+ });
}
/**
- * Register the "reset" migration command.
+ * Register the command.
*
* @return void
*/
- protected function registerMigrateResetCommand()
+ protected function registerMigrateFreshCommand()
{
- $this->app->singleton(
- 'command.migrate.reset',
- function ($app) {
- return new ResetCommand($app['migrator']);
- }
- );
+ $this->app->singleton(FreshCommand::class);
+ }
+
+ /**
+ * Register the command.
+ *
+ * @return void
+ */
+ protected function registerMigrateInstallCommand()
+ {
+ $this->app->singleton(InstallCommand::class, function ($app) {
+ return new InstallCommand($app['migration.repository']);
+ });
+ }
+
+ /**
+ * Register the command.
+ *
+ * @return void
+ */
+ protected function registerMigrateMakeCommand()
+ {
+ $this->app->singleton(MigrateMakeCommand::class, function ($app) {
+ // Once we have the migration creator registered, we will create the command
+ // and inject the creator. The creator is responsible for the actual file
+ // creation of the migrations, and may be extended by these developers.
+ $creator = $app['migration.creator'];
+
+ $composer = $app['composer'];
+
+ return new MigrateMakeCommand($creator, $composer);
+ });
}
/**
- * Register the "refresh" migration command.
+ * Register the command.
*
* @return void
*/
protected function registerMigrateRefreshCommand()
{
- $this->app->singleton(
- 'command.migrate.refresh',
- function () {
- return new RefreshCommand;
- }
- );
+ $this->app->singleton(RefreshCommand::class);
}
/**
- * Register the "rollback" migration command.
+ * Register the command.
+ *
+ * @return void
+ */
+ protected function registerMigrateResetCommand()
+ {
+ $this->app->singleton(ResetCommand::class, function ($app) {
+ return new ResetCommand($app['migrator']);
+ });
+ }
+
+ /**
+ * Register the command.
*
* @return void
*/
protected function registerMigrateRollbackCommand()
{
- $this->app->singleton(
- 'command.migrate.rollback',
- function ($app) {
- return new RollbackCommand($app['migrator']);
- }
- );
+ $this->app->singleton(RollbackCommand::class, function ($app) {
+ return new RollbackCommand($app['migrator']);
+ });
}
/**
- * Register the migration creator.
+ * Register the command.
*
* @return void
*/
- protected function registerCreator()
+ protected function registerMigrateStatusCommand()
{
- $this->app->singleton(
- 'migration.creator',
- function ($app) {
- return new MigrationCreator($app['files'], $app->basePath('stubs'));
- }
- );
+ $this->app->singleton(StatusCommand::class, function ($app) {
+ return new StatusCommand($app['migrator']);
+ });
+ }
+
+ /**
+ * Get the services provided by the provider.
+ *
+ * @return array
+ */
+ public function provides()
+ {
+ return array_merge([
+ 'migrator', 'migration.repository', 'migration.creator',
+ ], array_values($this->commands));
}
}
diff --git a/src/Database/Migration/Migrator.php b/src/Database/Migration/Migrator.php
index c7132eefc..922c59f17 100644
--- a/src/Database/Migration/Migrator.php
+++ b/src/Database/Migration/Migrator.php
@@ -51,8 +51,8 @@ public function run($paths = [], array $options = [])
* This is a carbon copy of the Laravel method
* except in the "!isset($files[$migration])" part.
*
- * @param array|string $paths
- * @param bool $pretend
+ * @param array|string $paths
+ * @param bool $pretend
* @return array
*/
public function reset($paths = [], $pretend = false)
@@ -102,8 +102,8 @@ public function reset($paths = [], $pretend = false)
/**
* Rollback the last migration operation.
*
- * @param array|string $paths
- * @param array $options
+ * @param array|string $paths
+ * @param array $options
* @return array
*/
public function rollback($paths = [], array $options = [])
@@ -116,19 +116,17 @@ public function rollback($paths = [], array $options = [])
/**
* Run "up" a migration instance.
*
- * @param string $file
- * @param int $batch
- * @param bool $pretend
+ * @param string $file
+ * @param int $batch
+ * @param bool $pretend
* @return void
*/
protected function runUp($file, $batch, $pretend)
{
- /**
- * Run our migrations first.
- *
- * @var Migration $migration
- */
- $migration = $this->resolve($file);
+ // First we will resolve a "real" instance of the migration class from this
+ // migration file name. Once we have the instances we can run the actual
+ // command such as "up" or "down", or we can just simulate the action.
+ $migration = $this->resolvePath($file);
/**
* Set the addon if there is
@@ -150,19 +148,17 @@ protected function runUp($file, $batch, $pretend)
/**
* Run "down" a migration instance.
*
- * @param string $file
- * @param object $migration
- * @param bool $pretend
+ * @param string $file
+ * @param object $migration
+ * @param bool $pretend
* @return void
*/
protected function runDown($file, $migration, $pretend)
{
- /**
- * Run our migrations first.
- *
- * @var Migration $migration
- */
- $migration = $this->resolve($file);
+ // First we will get the file name of the migration so we can resolve out an
+ // instance of the migration. Once we get an instance we can either run a
+ // pretend execution of the migration or we can run the real migration.
+ $migration = $this->resolvePath($file);
/**
* Set the addon if there is
@@ -182,29 +178,43 @@ protected function runDown($file, $migration, $pretend)
}
/**
- * Resolve a migration instance from a file.
+ * Resolve a migration instance from a migration path.
*
- * @param string $file
+ * @param string $path
* @return object
*/
- public function resolve($file)
+ protected function resolvePath(string $path)
{
- $migration = app((new MigrationName($file))->className());
+ $class = (new MigrationName($path))->className();
- $migration->migration = (new MigrationName($file))->migration();
+ if (class_exists($class) && realpath($path) == (new \ReflectionClass($class))->getFileName()) {
+ return new $class;
+ }
- return $migration;
+ $migration = static::$requiredPathCache[$path] ??= $this->files->getRequire($path);
+
+ if (is_object($migration)) {
+ return method_exists($migration, '__construct')
+ ? $this->files->getRequire($path)
+ : clone $migration;
+ }
+
+ return new $class;
}
/**
- * Resolve a migration instance from a migration path.
+ * Resolve a migration instance from a file.
*
- * @param string $path
+ * @param string $file
* @return object
*/
- protected function resolvePath(string $path)
+ public function resolve($file)
{
- return $this->resolve($path);
+ $migration = app((new MigrationName($file))->className());
+
+ $migration->migration = (new MigrationName($file))->migration();
+
+ return $migration;
}
/**
diff --git a/src/Image/Image.php b/src/Image/Image.php
index 48bc7ac9c..9e61cb4a8 100644
--- a/src/Image/Image.php
+++ b/src/Image/Image.php
@@ -2,6 +2,8 @@
namespace Anomaly\Streams\Platform\Image;
+use Illuminate\Filesystem\FilesystemManager;
+use League\Flysystem\FileAttributes;
use Mobile_Detect;
use League\Flysystem\File;
use Illuminate\Support\Str;
@@ -9,7 +11,6 @@
use Robbo\Presenter\Presenter;
use Collective\Html\HtmlBuilder;
use Intervention\Image\Constraint;
-use League\Flysystem\MountManager;
use Intervention\Image\ImageManager;
use Illuminate\Filesystem\Filesystem;
use Anomaly\FilesModule\File\FilePresenter;
@@ -640,10 +641,15 @@ private function shouldPublish($path)
return true;
}
- if (is_string($this->image) && str_is('*://*', $this->image) && filemtime($path) < app(
- 'League\Flysystem\MountManager'
- )->getTimestamp($this->image)) {
- return true;
+ if (is_string($this->image) && str_is('*://*', $this->image))
+ {
+ list($disk, $path) = explode('://', $path, 2);
+
+ if (filemtime($path) < app(
+ 'filesystem'
+ )->disk($disk)->getTimestamp($path)) {
+ return true;
+ }
}
if ($this->image instanceof File && filemtime($path) < $this->image->getTimestamp()) {
@@ -936,25 +942,32 @@ public function setImage($image)
protected function makeImage()
{
if ($this->image instanceof FileInterface) {
-
- $location = $this->image->location();
- $manager = app(MountManager::class);
+ $path = $this->image->path();
- $filesystem = $manager->getFilesystem($this->image->getDiskSlug());
+ $manager = app(FilesystemManager::class);
- if ($filesystem->getAdapter() instanceof AwsS3Adapter) {
- $location = str_replace(' ', '%20', $location);
+ $adapter = $manager->disk($this->image->getDiskSlug());
+
+ if ($adapter instanceof AwsS3Adapter) {
+ $path = str_replace(' ', '%20', $path);
}
- return $this->manager->make($manager->url($location));
+ return $this->manager->make($adapter->url($path));
}
if (is_string($this->image) && str_is('*://*', $this->image)) {
- return $this->manager->make(app(MountManager::class)->url($this->image));
+
+ list($disk, $path) = explode('://', $this->image->path(), 2);
+
+ $manager = app(FilesystemManager::class);
+
+ $adapter = $manager->disk($disk);
+
+ return $this->manager->make($adapter->url($path));
}
- if ($this->image instanceof File) {
+ if ($this->image instanceof FileAttributes) {
return $this->manager->make($this->image->read());
}
@@ -977,11 +990,16 @@ protected function makeImage()
protected function dumpImage()
{
if ($this->image instanceof FileInterface) {
- return app('League\Flysystem\MountManager')->read($this->image->location());
+ return app('filesystem')->disk($this->image->getDiskSlug())->read($this->image->path());
}
- if (is_string($this->image) && str_is('*://*', $this->image) && !starts_with($this->image, ['http', '//'])) {
- return app('League\Flysystem\MountManager')->read($this->image);
+ if (is_string($this->image) && str_is('*://*', $this->image))
+ {
+ list($disk, $path) = explode('://', $this->image, 2);
+
+ if (!starts_with($this->image, ['http', '//'])) {
+ return app('filesystem')->disk($disk)->read($path);
+ }
}
if (is_string($this->image) && (file_exists($this->image) || starts_with($this->image, ['http', '//']))) {
diff --git a/src/Installer/Console/Command/LoadApplicationInstallers.php b/src/Installer/Console/Command/LoadApplicationInstallers.php
index 954eaa917..07086595a 100644
--- a/src/Installer/Console/Command/LoadApplicationInstallers.php
+++ b/src/Installer/Console/Command/LoadApplicationInstallers.php
@@ -44,7 +44,7 @@ function (Kernel $console) {
'migrate',
[
'--force' => true,
- '--path' => 'vendor/anomaly/streams-platform/migrations/application',
+ '--path' => 'vendor/visiosoft/streams-platform/migrations/application',
]
);
}
diff --git a/src/Installer/Console/Command/LoadCoreInstallers.php b/src/Installer/Console/Command/LoadCoreInstallers.php
index d9b43d1c5..8f4136ad5 100644
--- a/src/Installer/Console/Command/LoadCoreInstallers.php
+++ b/src/Installer/Console/Command/LoadCoreInstallers.php
@@ -44,7 +44,7 @@ function (Kernel $console) {
'migrate',
[
'--force' => true,
- '--path' => 'vendor/anomaly/streams-platform/migrations/core',
+ '--path' => 'vendor/visiosoft/streams-platform/migrations/core',
]
);
}
diff --git a/src/Installer/Console/Command/LoadExtensionInstallers.php b/src/Installer/Console/Command/LoadExtensionInstallers.php
index 210f539e2..28d840eb9 100644
--- a/src/Installer/Console/Command/LoadExtensionInstallers.php
+++ b/src/Installer/Console/Command/LoadExtensionInstallers.php
@@ -52,7 +52,6 @@ function (Kernel $console) use ($extension, $application) {
'addon:install',
[
'addon' => $extension->getNamespace(),
- '--app' => $application->getReference(),
]
);
}
diff --git a/src/Installer/Console/Command/LoadModuleInstallers.php b/src/Installer/Console/Command/LoadModuleInstallers.php
index 5c4aad240..30c3dd760 100644
--- a/src/Installer/Console/Command/LoadModuleInstallers.php
+++ b/src/Installer/Console/Command/LoadModuleInstallers.php
@@ -56,7 +56,6 @@ function (Kernel $console) use ($module, $application) {
'addon:install',
[
'addon' => $module->getNamespace(),
- '--app' => $application->getReference(),
]
);
}
diff --git a/src/Lang/Loader.php b/src/Lang/Loader.php
index fd6beaa1c..c81628fac 100644
--- a/src/Lang/Loader.php
+++ b/src/Lang/Loader.php
@@ -52,7 +52,7 @@ class Loader extends FileLoader
*/
public function __construct(Filesystem $files, $path)
{
- $this->streams = base_path('vendor/anomaly/streams-platform/resources/lang');
+ $this->streams = base_path('vendor/visiosoft/streams-platform/resources/lang');
$this->application = app(Application::class);
$this->addons = app(AddonCollection::class);
diff --git a/src/Model/EloquentQueryBuilder.php b/src/Model/EloquentQueryBuilder.php
index d5d650eef..f0a5d8945 100644
--- a/src/Model/EloquentQueryBuilder.php
+++ b/src/Model/EloquentQueryBuilder.php
@@ -49,14 +49,14 @@ class EloquentQueryBuilder extends Builder
/**
* Execute the query as a "select" statement.
*
- * @param array $columns
+ * @param array $columns
* @return \Illuminate\Database\Eloquent\Collection|static[]
*/
public function get($columns = ['*'])
{
$key = $this->getCacheKey();
- $ttl = $this->model->ttl();
+ $ttl = $this->model->ttl();
$collection = $this->model->getCacheCollectionKey();
$enabled = config('streams::database.cache', false);
@@ -190,8 +190,8 @@ public function getCacheKey()
$name = $this->model->getConnectionName();
return $this->model->getCacheCollectionKey() . ':' . md5(
- $name . $this->toSql() . serialize($this->getBindings())
- );
+ $name . $this->toSql() . serialize($this->getBindings())
+ );
}
/**
@@ -234,7 +234,7 @@ public function cache($ttl = null)
/**
* Get fresh models / disable cache
*
- * @param boolean $fresh
+ * @param boolean $fresh
* @return object
*/
public function fresh($fresh = true)
@@ -249,7 +249,7 @@ public function fresh($fresh = true)
/**
* Update a record in the database.
*
- * @param array $values
+ * @param array $values
* @return int
*/
public function update(array $values)
@@ -340,9 +340,9 @@ public function translate($locale = null)
$model->getTranslationsTableName() . '.entry_id'
);
}
-
- $this->query->addSelect(
- [$model->getTableName() . '.*'] +
+ if (!count($this->query->getColumns())) {
+ $this->query->addSelect(
+ [$model->getTableName() . '.*'] +
array_map(
function ($column) use ($model) {
return $model->getTranslationTableName() . '.' . $column;
@@ -360,26 +360,64 @@ function ($column) use ($model) {
]
)
)
- );
+ );
+ }
/**
* removed to prevent data repeatation( getTranslationsTableName() )
*/
- //$this->query->groupBy([$model->getTableName() . '.id']);
+ $this->query->groupBy([$model->getTableName() . '.id']);
- /**
- * Grab either what matches or null because
- * that should cover every parent record.
- */
- $this->query->where(
- function (\Illuminate\Database\Query\Builder $query) use ($model, $locale) {
- $query->where($model->getTranslationsTableName() . '.locale', $locale ?: config('app.locale'));//active language
- $query->orWhere($model->getTranslationsTableName() . '.locale',setting_value('streams::default_locale'));//or default setting language
- $query->orWhere($model->getTranslationsTableName() . '.locale','en');//or default module language
+ return $this;
+ }
+
+ /**
+ * @param $columns
+ * @return EloquentQueryBuilder
+ * If there is a select and one of the added columns is a translatable column,
+ * translatable must be added to the query. Because when select is added,
+ * translatable columns are disabled and it is necessary to add it again.
+ */
+ public function select($columns = ['*'])
+ {
+ $columns = is_array($columns) ? $columns : func_get_args();
+
+ $model = $this->getModel();
+
+ if (
+ is_array($columns) &&
+ method_exists($model, 'getStream') &&
+ $model->getStream() &&
+ $model->getStream()->isTranslatable()) {
+
+ $translatableColumns = array_diff(
+ $this->getConnection()->getSchemaBuilder()->getColumnListing($model->getTranslationTableName()),
+ [
+ 'id',
+ 'entry_id',
+ 'created_at',
+ 'created_by_id',
+ 'updated_at',
+ 'updated_by_id',
+ 'sort_order',
+ ]
+ );
+
+
+ $translatable = false;
+ foreach ($columns as $column) {
+ if (in_array($column, $translatableColumns)) {
+ $translatable = true;
+ break;
+ }
}
- );
- return $this;
+ if ($translatable) {
+ $this->translate();
+ }
+ }
+
+ return parent::select($columns);
}
/**
diff --git a/src/Routing/UrlGenerator.php b/src/Routing/UrlGenerator.php
index 3ff5f2f9e..5bd4ed132 100644
--- a/src/Routing/UrlGenerator.php
+++ b/src/Routing/UrlGenerator.php
@@ -35,10 +35,13 @@ public function __construct(RouteCollection $routes, Request $request)
parent::__construct(app('router')->getRoutes(), $request);
$this->parser = app(Engine::class);
+ $forcedRoot = env('APP_URL',$request->root());
if (defined('LOCALE')) {
- $this->forceRootUrl($request->root() . '/' . LOCALE);
+ $forcedRoot.='/'.LOCALE;
}
+
+ $this->forceRootUrl($forcedRoot);
}
/**
diff --git a/src/Stream/Console/Command/WriteEntityCollection.php b/src/Stream/Console/Command/WriteEntityCollection.php
index 1dcce9452..22bd517f0 100644
--- a/src/Stream/Console/Command/WriteEntityCollection.php
+++ b/src/Stream/Console/Command/WriteEntityCollection.php
@@ -67,7 +67,7 @@ public function handle(Parser $parser, Filesystem $filesystem)
$path = $this->addon->getPath("src/{$entity}/{$entity}Collection.php");
$template = $filesystem->get(
- base_path("vendor/anomaly/streams-platform/resources/stubs/entity/collection.stub")
+ base_path("vendor/visiosoft/streams-platform/resources/stubs/entity/collection.stub")
);
$filesystem->makeDirectory(dirname($path), 0755, true, true);
diff --git a/src/Stream/Console/Command/WriteEntityController.php b/src/Stream/Console/Command/WriteEntityController.php
index 282808407..e358bbbdc 100644
--- a/src/Stream/Console/Command/WriteEntityController.php
+++ b/src/Stream/Console/Command/WriteEntityController.php
@@ -88,7 +88,7 @@ public function handle(Parser $parser, Filesystem $filesystem)
$path = $this->addon->getPath("src/Http/Controller/Admin/{$suffix}Controller.php");
$template = $filesystem->get(
- base_path('vendor/anomaly/streams-platform/resources/stubs/entity/http/controller/admin.stub')
+ base_path('vendor/visiosoft/streams-platform/resources/stubs/entity/http/controller/admin.stub')
);
$filesystem->makeDirectory(dirname($path), 0755, true, true);
diff --git a/src/Stream/Console/Command/WriteEntityCriteria.php b/src/Stream/Console/Command/WriteEntityCriteria.php
index e50df1356..9b8acad67 100644
--- a/src/Stream/Console/Command/WriteEntityCriteria.php
+++ b/src/Stream/Console/Command/WriteEntityCriteria.php
@@ -67,7 +67,7 @@ public function handle(Parser $parser, Filesystem $filesystem)
$path = $this->addon->getPath("src/{$entity}/{$entity}Criteria.php");
$template = $filesystem->get(
- base_path("vendor/anomaly/streams-platform/resources/stubs/entity/criteria.stub")
+ base_path("vendor/visiosoft/streams-platform/resources/stubs/entity/criteria.stub")
);
$filesystem->makeDirectory(dirname($path), 0755, true, true);
diff --git a/src/Stream/Console/Command/WriteEntityFactory.php b/src/Stream/Console/Command/WriteEntityFactory.php
index dce8f730e..0b166bea2 100644
--- a/src/Stream/Console/Command/WriteEntityFactory.php
+++ b/src/Stream/Console/Command/WriteEntityFactory.php
@@ -69,7 +69,7 @@ public function handle(Parser $parser, Filesystem $filesystem)
$path = $this->addon->getPath("src/{$entity}/{$entity}Factory.php");
$template = $filesystem->get(
- base_path("vendor/anomaly/streams-platform/resources/stubs/entity/factory.stub")
+ base_path("vendor/visiosoft/streams-platform/resources/stubs/entity/factory.stub")
);
$filesystem->makeDirectory(dirname($path), 0755, true, true);
diff --git a/src/Stream/Console/Command/WriteEntityFormBuilder.php b/src/Stream/Console/Command/WriteEntityFormBuilder.php
index b05e37241..ed017c5c2 100644
--- a/src/Stream/Console/Command/WriteEntityFormBuilder.php
+++ b/src/Stream/Console/Command/WriteEntityFormBuilder.php
@@ -67,7 +67,7 @@ public function handle(Parser $parser, Filesystem $filesystem)
$path = $this->addon->getPath("src/{$entity}/Form/{$entity}FormBuilder.php");
$template = $filesystem->get(
- base_path("vendor/anomaly/streams-platform/resources/stubs/entity/form/builder.stub")
+ base_path("vendor/visiosoft/streams-platform/resources/stubs/entity/form/builder.stub")
);
$filesystem->makeDirectory(dirname($path), 0755, true, true);
diff --git a/src/Stream/Console/Command/WriteEntityModel.php b/src/Stream/Console/Command/WriteEntityModel.php
index 9ce1034a1..95fabdb78 100644
--- a/src/Stream/Console/Command/WriteEntityModel.php
+++ b/src/Stream/Console/Command/WriteEntityModel.php
@@ -73,7 +73,7 @@ public function handle(Parser $parser, Filesystem $filesystem)
$path = $this->addon->getPath("src/{$entity}/{$entity}Model.php");
$template = $filesystem->get(
- base_path("vendor/anomaly/streams-platform/resources/stubs/entity/model.stub")
+ base_path("vendor/visiosoft/streams-platform/resources/stubs/entity/model.stub")
);
$filesystem->makeDirectory(dirname($path), 0755, true, true);
diff --git a/src/Stream/Console/Command/WriteEntityModelInterface.php b/src/Stream/Console/Command/WriteEntityModelInterface.php
index d74dfa6c2..fe317a229 100644
--- a/src/Stream/Console/Command/WriteEntityModelInterface.php
+++ b/src/Stream/Console/Command/WriteEntityModelInterface.php
@@ -67,7 +67,7 @@ public function handle(Parser $parser, Filesystem $filesystem)
$path = $this->addon->getPath("src/{$entity}/Contract/{$entity}Interface.php");
$template = $filesystem->get(
- base_path("vendor/anomaly/streams-platform/resources/stubs/entity/contract/entry.stub")
+ base_path("vendor/visiosoft/streams-platform/resources/stubs/entity/contract/entry.stub")
);
$filesystem->makeDirectory(dirname($path), 0755, true, true);
diff --git a/src/Stream/Console/Command/WriteEntityObserver.php b/src/Stream/Console/Command/WriteEntityObserver.php
index 693b76621..b885ff9a9 100644
--- a/src/Stream/Console/Command/WriteEntityObserver.php
+++ b/src/Stream/Console/Command/WriteEntityObserver.php
@@ -67,7 +67,7 @@ public function handle(Parser $parser, Filesystem $filesystem)
$path = $this->addon->getPath("src/{$entity}/{$entity}Observer.php");
$template = $filesystem->get(
- base_path("vendor/anomaly/streams-platform/resources/stubs/entity/observer.stub")
+ base_path("vendor/visiosoft/streams-platform/resources/stubs/entity/observer.stub")
);
$filesystem->makeDirectory(dirname($path), 0755, true, true);
diff --git a/src/Stream/Console/Command/WriteEntityPresenter.php b/src/Stream/Console/Command/WriteEntityPresenter.php
index 872c4081c..9b56dcff2 100644
--- a/src/Stream/Console/Command/WriteEntityPresenter.php
+++ b/src/Stream/Console/Command/WriteEntityPresenter.php
@@ -67,7 +67,7 @@ public function handle(Parser $parser, Filesystem $filesystem)
$path = $this->addon->getPath("src/{$entity}/{$entity}Presenter.php");
$template = $filesystem->get(
- base_path("vendor/anomaly/streams-platform/resources/stubs/entity/presenter.stub")
+ base_path("vendor/visiosoft/streams-platform/resources/stubs/entity/presenter.stub")
);
$filesystem->makeDirectory(dirname($path), 0755, true, true);
diff --git a/src/Stream/Console/Command/WriteEntityRepository.php b/src/Stream/Console/Command/WriteEntityRepository.php
index 2b3853baf..989af3069 100644
--- a/src/Stream/Console/Command/WriteEntityRepository.php
+++ b/src/Stream/Console/Command/WriteEntityRepository.php
@@ -71,7 +71,7 @@ public function handle(Parser $parser, Filesystem $filesystem)
$path = $this->addon->getPath("src/{$entity}/{$entity}Repository.php");
$template = $filesystem->get(
- base_path("vendor/anomaly/streams-platform/resources/stubs/entity/repository.stub")
+ base_path("vendor/visiosoft/streams-platform/resources/stubs/entity/repository.stub")
);
$filesystem->makeDirectory(dirname($path), 0755, true, true);
diff --git a/src/Stream/Console/Command/WriteEntityRepositoryInterface.php b/src/Stream/Console/Command/WriteEntityRepositoryInterface.php
index 17b9e0aff..a21eb48c4 100644
--- a/src/Stream/Console/Command/WriteEntityRepositoryInterface.php
+++ b/src/Stream/Console/Command/WriteEntityRepositoryInterface.php
@@ -67,7 +67,7 @@ public function handle(Parser $parser, Filesystem $filesystem)
$path = $this->addon->getPath("src/{$entity}/Contract/{$entity}RepositoryInterface.php");
$template = $filesystem->get(
- base_path("vendor/anomaly/streams-platform/resources/stubs/entity/contract/repository.stub")
+ base_path("vendor/visiosoft/streams-platform/resources/stubs/entity/contract/repository.stub")
);
$filesystem->makeDirectory(dirname($path), 0755, true, true);
diff --git a/src/Stream/Console/Command/WriteEntityRouter.php b/src/Stream/Console/Command/WriteEntityRouter.php
index 8ea612cc3..b2165ecd3 100644
--- a/src/Stream/Console/Command/WriteEntityRouter.php
+++ b/src/Stream/Console/Command/WriteEntityRouter.php
@@ -67,7 +67,7 @@ public function handle(Parser $parser, Filesystem $filesystem)
$path = $this->addon->getPath("src/{$entity}/{$entity}Router.php");
$template = $filesystem->get(
- base_path("vendor/anomaly/streams-platform/resources/stubs/entity/router.stub")
+ base_path("vendor/visiosoft/streams-platform/resources/stubs/entity/router.stub")
);
$filesystem->makeDirectory(dirname($path), 0755, true, true);
diff --git a/src/Stream/Console/Command/WriteEntityRoutes.php b/src/Stream/Console/Command/WriteEntityRoutes.php
index 519a07e23..2d3d3e637 100644
--- a/src/Stream/Console/Command/WriteEntityRoutes.php
+++ b/src/Stream/Console/Command/WriteEntityRoutes.php
@@ -69,7 +69,7 @@ public function handle(Parser $parser, Filesystem $filesystem)
$path = $this->addon->getPath("resources/routes/{$this->slug}.php");
$template = $filesystem->get(
- base_path("vendor/anomaly/streams-platform/resources/stubs/entity/http/routes.stub")
+ base_path("vendor/visiosoft/streams-platform/resources/stubs/entity/http/routes.stub")
);
$filesystem->makeDirectory(dirname($path), 0755, true, true);
diff --git a/src/Stream/Console/Command/WriteEntitySeeder.php b/src/Stream/Console/Command/WriteEntitySeeder.php
index f8d614ca4..5bef7c00e 100644
--- a/src/Stream/Console/Command/WriteEntitySeeder.php
+++ b/src/Stream/Console/Command/WriteEntitySeeder.php
@@ -67,7 +67,7 @@ public function handle(Parser $parser, Filesystem $filesystem)
$path = $this->addon->getPath("src/{$entity}/{$entity}Seeder.php");
$template = $filesystem->get(
- base_path("vendor/anomaly/streams-platform/resources/stubs/entity/seeder.stub")
+ base_path("vendor/visiosoft/streams-platform/resources/stubs/entity/seeder.stub")
);
$filesystem->makeDirectory(dirname($path), 0755, true, true);
diff --git a/src/Stream/Console/Command/WriteEntityTableBuilder.php b/src/Stream/Console/Command/WriteEntityTableBuilder.php
index b4552a254..c125723e8 100644
--- a/src/Stream/Console/Command/WriteEntityTableBuilder.php
+++ b/src/Stream/Console/Command/WriteEntityTableBuilder.php
@@ -67,7 +67,7 @@ public function handle(Parser $parser, Filesystem $filesystem)
$path = $this->addon->getPath("src/{$entity}/Table/{$entity}TableBuilder.php");
$template = $filesystem->get(
- base_path("vendor/anomaly/streams-platform/resources/stubs/entity/table/builder.stub")
+ base_path("vendor/visiosoft/streams-platform/resources/stubs/entity/table/builder.stub")
);
$filesystem->makeDirectory(dirname($path), 0755, true, true);
diff --git a/src/Stream/Console/Command/WriteEntityTestCases.php b/src/Stream/Console/Command/WriteEntityTestCases.php
index 2e0dd51e5..a4e08a55e 100644
--- a/src/Stream/Console/Command/WriteEntityTestCases.php
+++ b/src/Stream/Console/Command/WriteEntityTestCases.php
@@ -71,7 +71,7 @@ public function handle(Parser $parser, Filesystem $filesystem)
$extends = "{$addon}TestCase";
$template = $filesystem->get(
- base_path("vendor/anomaly/streams-platform/resources/stubs/entity/test.stub")
+ base_path("vendor/visiosoft/streams-platform/resources/stubs/entity/test.stub")
);
/* @var SplFileInfo $file */
diff --git a/src/Stream/Console/Command/WriteEntityTreeBuilder.php b/src/Stream/Console/Command/WriteEntityTreeBuilder.php
index 424d4135b..968db3225 100644
--- a/src/Stream/Console/Command/WriteEntityTreeBuilder.php
+++ b/src/Stream/Console/Command/WriteEntityTreeBuilder.php
@@ -67,7 +67,7 @@ public function handle(Parser $parser, Filesystem $filesystem)
$path = $this->addon->getPath("src/{$entity}/Tree/{$entity}TreeBuilder.php");
$template = $filesystem->get(
- base_path('vendor/anomaly/streams-platform/resources/stubs/entity/tree/builder.stub')
+ base_path('vendor/visiosoft/streams-platform/resources/stubs/entity/tree/builder.stub')
);
$filesystem->makeDirectory(dirname($path), 0755, true, true);
diff --git a/src/StreamsCompilerProvider.php b/src/StreamsCompilerProvider.php
index 7ab41e6a2..b71d35c48 100644
--- a/src/StreamsCompilerProvider.php
+++ b/src/StreamsCompilerProvider.php
@@ -21,46 +21,46 @@ public static function compiles()
return [
// Models
- 'vendor/anomaly/streams-platform/src/Entry/EntryModel.php',
- 'vendor/anomaly/streams-platform/src/Field/FieldModel.php',
- 'vendor/anomaly/streams-platform/src/Stream/StreamModel.php',
- 'vendor/anomaly/streams-platform/src/Assignment/AssignmentModel.php',
+ 'vendor/visiosoft/streams-platform/src/Entry/EntryModel.php',
+ 'vendor/visiosoft/streams-platform/src/Field/FieldModel.php',
+ 'vendor/visiosoft/streams-platform/src/Stream/StreamModel.php',
+ 'vendor/visiosoft/streams-platform/src/Assignment/AssignmentModel.php',
// Addons
- 'vendor/anomaly/streams-platform/src/Addon/Theme/Theme.php',
- 'vendor/anomaly/streams-platform/src/Addon/Module/Module.php',
- 'vendor/anomaly/streams-platform/src/Addon/Plugin/Plugin.php',
- 'vendor/anomaly/streams-platform/src/Addon/Extension/Extension.php',
- 'vendor/anomaly/streams-platform/src/Addon/FieldType/FieldType.php',
+ 'vendor/visiosoft/streams-platform/src/Addon/Theme/Theme.php',
+ 'vendor/visiosoft/streams-platform/src/Addon/Module/Module.php',
+ 'vendor/visiosoft/streams-platform/src/Addon/Plugin/Plugin.php',
+ 'vendor/visiosoft/streams-platform/src/Addon/Extension/Extension.php',
+ 'vendor/visiosoft/streams-platform/src/Addon/FieldType/FieldType.php',
// Addon Collections
- 'vendor/anomaly/streams-platform/src/Addon/Theme/ThemeCollection.php',
- 'vendor/anomaly/streams-platform/src/Addon/Module/ModuleCollection.php',
- 'vendor/anomaly/streams-platform/src/Addon/Plugin/PluginCollection.php',
- 'vendor/anomaly/streams-platform/src/Addon/Extension/ExtensionCollection.php',
- 'vendor/anomaly/streams-platform/src/Addon/FieldType/FieldTypeCollection.php',
+ 'vendor/visiosoft/streams-platform/src/Addon/Theme/ThemeCollection.php',
+ 'vendor/visiosoft/streams-platform/src/Addon/Module/ModuleCollection.php',
+ 'vendor/visiosoft/streams-platform/src/Addon/Plugin/PluginCollection.php',
+ 'vendor/visiosoft/streams-platform/src/Addon/Extension/ExtensionCollection.php',
+ 'vendor/visiosoft/streams-platform/src/Addon/FieldType/FieldTypeCollection.php',
// Support
- 'vendor/anomaly/streams-platform/src/Support/Parser.php',
- 'vendor/anomaly/streams-platform/src/Support/Template.php',
- 'vendor/anomaly/streams-platform/src/Support/Observer.php',
- 'vendor/anomaly/streams-platform/src/Support/Resolver.php',
- 'vendor/anomaly/streams-platform/src/Support/Decorator.php',
- 'vendor/anomaly/streams-platform/src/Support/Evaluator.php',
- 'vendor/anomaly/streams-platform/src/Support/Authorizer.php',
- 'vendor/anomaly/streams-platform/src/Support/Translator.php',
- 'vendor/anomaly/streams-platform/src/Support/Configurator.php',
+ 'vendor/visiosoft/streams-platform/src/Support/Parser.php',
+ 'vendor/visiosoft/streams-platform/src/Support/Template.php',
+ 'vendor/visiosoft/streams-platform/src/Support/Observer.php',
+ 'vendor/visiosoft/streams-platform/src/Support/Resolver.php',
+ 'vendor/visiosoft/streams-platform/src/Support/Decorator.php',
+ 'vendor/visiosoft/streams-platform/src/Support/Evaluator.php',
+ 'vendor/visiosoft/streams-platform/src/Support/Authorizer.php',
+ 'vendor/visiosoft/streams-platform/src/Support/Translator.php',
+ 'vendor/visiosoft/streams-platform/src/Support/Configurator.php',
// Miscellaneous
- 'vendor/anomaly/streams-platform/src/Http/Middleware/MiddlewareCollection.php',
- 'vendor/anomaly/streams-platform/src/Addon/Extension/ExtensionModel.php',
- 'vendor/anomaly/streams-platform/src/Addon/Module/ModuleModel.php',
- 'vendor/anomaly/streams-platform/src/View/ViewMobileOverrides.php',
- 'vendor/anomaly/streams-platform/src/Model/EloquentPresenter.php',
- 'vendor/anomaly/streams-platform/src/Addon/AddonIntegrator.php',
- 'vendor/anomaly/streams-platform/src/Entry/EntryPresenter.php',
- 'vendor/anomaly/streams-platform/src/Addon/AddonManager.php',
- 'vendor/anomaly/streams-platform/src/View/ViewOverrides.php',
+ 'vendor/visiosoft/streams-platform/src/Http/Middleware/MiddlewareCollection.php',
+ 'vendor/visiosoft/streams-platform/src/Addon/Extension/ExtensionModel.php',
+ 'vendor/visiosoft/streams-platform/src/Addon/Module/ModuleModel.php',
+ 'vendor/visiosoft/streams-platform/src/View/ViewMobileOverrides.php',
+ 'vendor/visiosoft/streams-platform/src/Model/EloquentPresenter.php',
+ 'vendor/visiosoft/streams-platform/src/Addon/AddonIntegrator.php',
+ 'vendor/visiosoft/streams-platform/src/Entry/EntryPresenter.php',
+ 'vendor/visiosoft/streams-platform/src/Addon/AddonManager.php',
+ 'vendor/visiosoft/streams-platform/src/View/ViewOverrides.php',
];
}
}
diff --git a/src/StreamsServiceProvider.php b/src/StreamsServiceProvider.php
index de00f8715..6f3925c6f 100644
--- a/src/StreamsServiceProvider.php
+++ b/src/StreamsServiceProvider.php
@@ -404,7 +404,7 @@ function () {
*/
$this->app->instance(
'streams.path',
- $this->app->make('path.base') . '/vendor/anomaly/streams-platform'
+ $this->app->make('path.base') . '/vendor/visiosoft/streams-platform'
);
/*
diff --git a/src/Ui/ControlPanel/Component/Navigation/NavigationBuilder.php b/src/Ui/ControlPanel/Component/Navigation/NavigationBuilder.php
index b9d387877..8e8c0484b 100644
--- a/src/Ui/ControlPanel/Component/Navigation/NavigationBuilder.php
+++ b/src/Ui/ControlPanel/Component/Navigation/NavigationBuilder.php
@@ -29,12 +29,12 @@ class NavigationBuilder
/**
* Create a new NavigationBuilder instance.
*
- * @param NavigationInput $input
+ * @param NavigationInput $input
* @param NavigationFactory $factory
*/
public function __construct(NavigationInput $input, NavigationFactory $factory)
{
- $this->input = $input;
+ $this->input = $input;
$this->factory = $factory;
}
@@ -45,12 +45,28 @@ public function __construct(NavigationInput $input, NavigationFactory $factory)
*/
public function build(ControlPanelBuilder $builder)
{
+
$controlPanel = $builder->getControlPanel();
$this->input->read($builder);
-
foreach ($builder->getNavigation() as $link) {
- $controlPanel->addNavigationLink($this->factory->make($link));
+ if (!empty($link['sections'])) {
+ foreach ($link['sections'] as $key => $section) {
+ $sectionLink = $link;
+ if (isset($section['href'])) {
+ $sectionLink['attributes']['href'] = $section['href'];
+ } else {
+ $sectionLink['attributes']['href'] .= "/" . $key;
+ }
+ $sectionLink['title'] = $sectionLink['slug'] . "::section." . $key . ".title";
+ if (empty($sectionLink['title'])) {
+
+ }
+ $controlPanel->addNavigationLink($this->factory->make($sectionLink));
+ }
+ } else {
+ $controlPanel->addNavigationLink($this->factory->make($link));
+ }
}
}
}
diff --git a/src/Ui/ControlPanel/Component/Navigation/NavigationHandler.php b/src/Ui/ControlPanel/Component/Navigation/NavigationHandler.php
index 22a51977e..51a5b390b 100644
--- a/src/Ui/ControlPanel/Component/Navigation/NavigationHandler.php
+++ b/src/Ui/ControlPanel/Component/Navigation/NavigationHandler.php
@@ -40,6 +40,7 @@ function (Module $module) {
'icon' => $module->getIcon(),
'title' => $module->getTitle(),
'slug' => $module->getNamespace(),
+ 'sections' => $module->getSections(),
'href' => 'admin/' . $module->getSlug(),
];
},
diff --git a/tests/Unit/Asset/AssetTest.php b/tests/Unit/Asset/AssetTest.php
index 6d55dfcae..6238b1ccc 100644
--- a/tests/Unit/Asset/AssetTest.php
+++ b/tests/Unit/Asset/AssetTest.php
@@ -204,11 +204,11 @@ public function testAddPath()
$asset->addPath(
'test',
- base_path('vendor/anomaly/streams-platform/addons/anomaly/test-module/resources')
+ base_path('vendor/visiosoft/streams-platform/addons/anomaly/test-module/resources')
);
$this->assertEquals(
- base_path('vendor/anomaly/streams-platform/addons/anomaly/test-module/resources/styles/test.css'),
+ base_path('vendor/visiosoft/streams-platform/addons/anomaly/test-module/resources/styles/test.css'),
$asset->realPath('test::styles/test.css')
);
}