Skip to content

Commit

Permalink
Merge pull request AsgardCms#792 from imagina/upstream-master
Browse files Browse the repository at this point in the history
Update to Laravel v7.29.3
  • Loading branch information
nWidart authored Nov 10, 2020
2 parents e01fbfc + fa7938f commit 8c1e4b9
Show file tree
Hide file tree
Showing 143 changed files with 716 additions and 630 deletions.
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

MAIL_DRIVER=smtp
MAIL_MAILER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ package-lock.json
yarn.lock
.phpunit.result.cache
.php_cs.cache
.idea
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ cache:
- $HOME/.composer/cache

env:
- LARAVEL_VERSION="~5.7" TESTBENCH_VERSION="~3.7"
- LARAVEL_VERSION="~7.0" TESTBENCH_VERSION="~5.7"

before_script:
- phpenv config-rm xdebug.ini
Expand Down
10 changes: 6 additions & 4 deletions Modules/Core/Blade/AsgardEditorDirective.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

namespace Modules\Core\Blade;

use Illuminate\Support\Arr;

class AsgardEditorDirective
{
private $content;
Expand All @@ -26,9 +28,9 @@ public function show($arguments)
*/
private function extractArguments(array $arguments)
{
$this->fieldName = array_get($arguments, 0);
$this->labelName = array_get($arguments, 1);
$this->content = array_get($arguments, 2);
$this->lang = array_get($arguments, 3);
$this->fieldName = Arr::get($arguments, 0);
$this->labelName = Arr::get($arguments, 1);
$this->content = Arr::get($arguments, 2);
$this->lang = Arr::get($arguments, 3);
}
}
5 changes: 3 additions & 2 deletions Modules/Core/Console/DownloadModuleCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Modules\Core\Console;

use Illuminate\Console\Command;
use Illuminate\Support\Str;
use Modules\Core\Downloader\Downloader;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputOption;
Expand Down Expand Up @@ -98,11 +99,11 @@ protected function getOptions()

private function extractPackageNameFrom($package)
{
if (str_contains($package, '/') === false) {
if (Str::contains($package, '/') === false) {
throw new \Exception('You need to use vendor/name structure');
}

return studly_case(substr(strrchr($package, '/'), 1));
return Str::studly(substr(strrchr($package, '/'), 1));
}

/**
Expand Down
5 changes: 3 additions & 2 deletions Modules/Core/Downloader/Downloader.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use GuzzleHttp\Client;
use Illuminate\Filesystem\Filesystem;
use Illuminate\Support\Str;
use RuntimeException;
use Symfony\Component\Console\Helper\ProgressBar;
use Symfony\Component\Console\Output\OutputInterface;
Expand Down Expand Up @@ -157,11 +158,11 @@ private function getLatestVersionUrl()

private function extractPackageNameFrom($package)
{
if (str_contains($package, '/') === false) {
if (Str::contains($package, '/') === false) {
throw new \Exception('You need to use vendor/name structure');
}

return studly_case(substr(strrchr($package, '/'), 1));
return Str::studly(substr(strrchr($package, '/'), 1));
}

public function forBranch($branchName)
Expand Down
5 changes: 3 additions & 2 deletions Modules/Core/Events/CollectingAssets.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Modules\Core\Events;

use Illuminate\Support\Str;
use Modules\Core\Foundation\Asset\Pipeline\AssetPipeline;

class CollectingAssets
Expand Down Expand Up @@ -43,7 +44,7 @@ public function onRoute($route)
{
$request = request();

return str_is($route, $request->route()->getName());
return Str::is($route, $request->route()->getName());
}

/**
Expand All @@ -56,7 +57,7 @@ public function onRoutes(array $routes)
$request = request();

foreach ($routes as $route) {
if (str_is($route, $request->route()->getName()) === true) {
if (Str::is($route, $request->route()->getName()) === true) {
return true;
}
}
Expand Down
4 changes: 3 additions & 1 deletion Modules/Core/Foundation/Asset/Types/CdnAsset.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

namespace Modules\Core\Foundation\Asset\Types;

use Illuminate\Support\Arr;

class CdnAsset implements AssetType
{
/**
Expand All @@ -20,6 +22,6 @@ public function __construct($path)
*/
public function url()
{
return array_get($this->path, 'cdn');
return Arr::get($this->path, 'cdn');
}
}
3 changes: 2 additions & 1 deletion Modules/Core/Foundation/Asset/Types/ModuleAsset.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Modules\Core\Foundation\Asset\Types;

use Illuminate\Support\Arr;
use Nwidart\Modules\Facades\Module;

class ModuleAsset implements AssetType
Expand All @@ -27,6 +28,6 @@ public function url()

private function getPath()
{
return array_get($this->path, 'module');
return Arr::get($this->path, 'module');
}
}
3 changes: 2 additions & 1 deletion Modules/Core/Foundation/Asset/Types/ThemeAsset.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Modules\Core\Foundation\Asset\Types;

use FloatingPoint\Stylist\Facades\ThemeFacade as Theme;
use Illuminate\Support\Arr;

class ThemeAsset implements AssetType
{
Expand All @@ -27,6 +28,6 @@ public function url()

private function getPath()
{
return array_get($this->path, 'theme');
return Arr::get($this->path, 'theme');
}
}
3 changes: 2 additions & 1 deletion Modules/Core/Internationalisation/BaseFormRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Modules\Core\Internationalisation;

use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Arr;
use Mcamara\LaravelLocalization\Facades\LaravelLocalization;

abstract class BaseFormRequest extends FormRequest
Expand Down Expand Up @@ -86,7 +87,7 @@ public function withTranslations()
$translations[$key] = $this->get($key);
}
$results['translations'] = $translations;
array_forget($results, $locales);
Arr::forget($results, $locales);

return $results;
}
Expand Down
2 changes: 1 addition & 1 deletion Modules/Core/Internationalisation/Translatable.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ trait Translatable
{
use \Astrotomic\Translatable\Translatable;

public function save(array $options = array())
public function save(array $options = [])
{
$tempTranslations = $this->translations;
if ($this->exists) {
Expand Down
16 changes: 9 additions & 7 deletions Modules/Core/Providers/CoreServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@

use Illuminate\Http\Request;
use Illuminate\Routing\Router;
use Illuminate\Support\Arr;
use Illuminate\Support\Facades\Blade;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Str;
use Modules\Core\Blade\AsgardEditorDirective;
use Modules\Core\Console\DeleteModuleCommand;
use Modules\Core\Console\DownloadModuleCommand;
Expand Down Expand Up @@ -90,8 +92,8 @@ public function register()
$this->getSidebarClassForModule('core', RegisterCoreSidebar::class)
);
$this->app['events']->listen(LoadingBackendTranslations::class, function (LoadingBackendTranslations $event) {
$event->load('core', array_dot(trans('core::core')));
$event->load('sidebar', array_dot(trans('core::sidebar')));
$event->load('core', Arr::dot(trans('core::core')));
$event->load('sidebar', Arr::dot(trans('core::sidebar')));
});
}

Expand All @@ -102,7 +104,7 @@ public function register()
*/
public function provides()
{
return array();
return [];
}

/**
Expand Down Expand Up @@ -201,14 +203,14 @@ protected function registerViewNamespace(Module $module, array $themes)
$moduleConfig = $this->app['config']->get($configKey . '.useViewNamespaces');

if (count($themes) > 0) {
if ($themes['backend'] !== null && array_get($moduleConfig, 'backend-theme') === true) {
if ($themes['backend'] !== null && Arr::get($moduleConfig, 'backend-theme') === true) {
$hints[] = $themes['backend'] . '/views/modules/' . $moduleName;
}
if ($themes['frontend'] !== null && array_get($moduleConfig, 'frontend-theme') === true) {
if ($themes['frontend'] !== null && Arr::get($moduleConfig, 'frontend-theme') === true) {
$hints[] = $themes['frontend'] . '/views/modules/' . $moduleName;
}
}
if (array_get($moduleConfig, 'resources') === true) {
if (Arr::get($moduleConfig, 'resources') === true) {
$hints[] = base_path('resources/views/asgard/' . $moduleName);
}
}
Expand Down Expand Up @@ -351,7 +353,7 @@ public function bladeDirectives()
private function onBackend()
{
$url = app(Request::class)->path();
if (str_contains($url, config('asgard.core.core.admin-prefix'))) {
if (Str::contains($url, config('asgard.core.core.admin-prefix'))) {
return true;
}

Expand Down
5 changes: 2 additions & 3 deletions Modules/Core/Providers/SidebarServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@

namespace Modules\Core\Providers;

use Illuminate\Contracts\Support\DeferrableProvider;
use Illuminate\Support\ServiceProvider;
use Maatwebsite\Sidebar\SidebarManager;
use Modules\Core\Sidebar\AdminSidebar;

class SidebarServiceProvider extends ServiceProvider
class SidebarServiceProvider extends ServiceProvider implements DeferrableProvider
{
protected $defer = true;

/**
* Register the service provider.
* @return void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<select multiple class="locales" name="{{ $settingName }}[]" id="{{ $settingName }}">
@foreach ($locales as $id => $locale)
<option value="{{ $id }}" {{ isset($dbSettings[$settingName]) && isset(array_flip(json_decode($dbSettings[$settingName]->plainValue))[$id]) ? 'selected' : '' }}>
{{ array_get($locale, 'name') }}
{{ Arr::get($locale, 'name') }}
</option>
@endforeach
</select>
Expand Down
4 changes: 2 additions & 2 deletions Modules/Core/Tests/BaseTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ protected function getEnvironmentSetUp($app)
{
$app['path.base'] = __DIR__ . '/..';
$app['config']->set('database.default', 'sqlite');
$app['config']->set('database.connections.sqlite', array(
$app['config']->set('database.connections.sqlite', [
'driver' => 'sqlite',
'database' => ':memory:',
'prefix' => '',
));
]);
$app['config']->set('translatable.locales', ['en', 'fr']);
}

Expand Down
6 changes: 3 additions & 3 deletions Modules/Core/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@
"require": {
"php": "^7.1.3",
"composer/installers": "~1.0",
"nwidart/laravel-modules": "^4.0",
"nwidart/laravel-modules": "^6.0",
"laravelcollective/html": "5.7.*",
"laracasts/presenter": "^0.2.4",
"astrotomic/laravel-translatable": "^11.1",
"mcamara/laravel-localization": "^1.6",
"floatingpoint/stylist": "dev-master",
"imagina/stylist": "^2.0",
"maatwebsite/laravel-sidebar": "^2.4",
"yajra/laravel-datatables-oracle": "~8.0",
"tightenco/ziggy": "~0.4"
"tightenco/ziggy": "^0.9.4"
},
"require-dev": {
"phpunit/phpunit": "~7.0",
Expand Down
3 changes: 2 additions & 1 deletion Modules/Dashboard/Foundation/Widgets/BaseWidget.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Modules\Dashboard\Foundation\Widgets;

use Illuminate\Contracts\View\Factory;
use Illuminate\Support\Str;
use Modules\Dashboard\Composers\WidgetViewComposer;

abstract class BaseWidget
Expand All @@ -21,7 +22,7 @@ public function boot()
->with($this->data())
->render();

$sluggedName = str_slug($this->name());
$sluggedName = Str::slug($this->name());

$widgetViewComposer
->setWidgetName($sluggedName)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public function reset()
private function bootWidgets(RepositoryInterface $modules)
{
foreach ($modules->allEnabled() as $module) {
if (! $module->widgets) {
if (! isset($module->widgets)) {
continue;
}
foreach ($module->widgets as $widgetClass) {
Expand Down
5 changes: 3 additions & 2 deletions Modules/Dashboard/Providers/DashboardServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Modules\Dashboard\Providers;

use Illuminate\Support\Arr;
use Illuminate\Support\ServiceProvider;
use Modules\Core\Events\BuildingSidebar;
use Modules\Core\Events\LoadingBackendTranslations;
Expand Down Expand Up @@ -47,7 +48,7 @@ public function register()
);

$this->app['events']->listen(LoadingBackendTranslations::class, function (LoadingBackendTranslations $event) {
$event->load('dashboard', array_dot(trans('dashboard::dashboard')));
$event->load('dashboard', Arr::dot(trans('dashboard::dashboard')));
});
}

Expand Down Expand Up @@ -75,6 +76,6 @@ public function boot(StylistThemeManager $theme)
*/
public function provides()
{
return array();
return [];
}
}
9 changes: 5 additions & 4 deletions Modules/Media/Blade/MediaMultipleDirective.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Modules\Media\Blade;

use Illuminate\Support\Arr;
use Modules\Media\Composers\Backend\PartialAssetComposer;

class MediaMultipleDirective
Expand Down Expand Up @@ -49,9 +50,9 @@ public function show($arguments)
*/
private function extractArguments(array $arguments)
{
$this->zone = array_get($arguments, 0);
$this->entity = array_get($arguments, 1);
$this->view = array_get($arguments, 2);
$this->name = array_get($arguments, 3);
$this->zone = Arr::get($arguments, 0);
$this->entity = Arr::get($arguments, 1);
$this->view = Arr::get($arguments, 2);
$this->name = Arr::get($arguments, 3);
}
}
Loading

0 comments on commit 8c1e4b9

Please sign in to comment.