Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add: Laravel 9.x compatibility #843

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 20 additions & 14 deletions Modules/Core/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,30 @@
"source": "https://github.com/AsgardCms/Core"
},
"require": {
"php": "^7.1.3",
"php": "^8.0",
"composer/installers": "~1.0",
"nwidart/laravel-modules": "^8.0",
"laravelcollective/html": "^6.0",
"laracasts/presenter": "^0.2.4",
"astrotomic/laravel-translatable": "^11.9",
"mcamara/laravel-localization": "^1.6",
"imagina/stylist": "^3.0",
"maatwebsite/laravel-sidebar": "^2.4",
"yajra/laravel-datatables-oracle": "~9.0",
"tightenco/ziggy": "^0.9.4"
"nwidart/laravel-modules": "~9.0",
"laravelcollective/html": "~6.2",
"laracasts/presenter": "~0.2",
"astrotomic/laravel-translatable": "~11.11",
"mcamara/laravel-localization": "~1.7",
"imagina/stylist": "dev-master",
"maatwebsite/laravel-sidebar": "~2.1",
"yajra/laravel-datatables-oracle": "~10.2",
"tightenco/ziggy": "~1.5"
},
"require-dev": {
"phpunit/phpunit": "~7.0",
"orchestra/testbench": "3.8.*",
"mockery/mockery": "^0.9.4",
"friendsofphp/php-cs-fixer": "^2.12"
"phpunit/phpunit": "~9.5",
"orchestra/testbench": "~7.16",
"mockery/mockery": "^1.4.4",
"friendsofphp/php-cs-fixer": "^3.13"
},
"repositories": [
{
"type": "git",
"url": "https://github.com/dineshsailor/imagina-stylist"
}
],
"suggest": {
"asgardcms/notification-module": "Allows notifications to be sent to the user. Optionally real-time notifications."
},
Expand Down
11 changes: 8 additions & 3 deletions Modules/Dashboard/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,22 @@
"source": "https://github.com/AsgardCms/Dashboard"
},
"require": {
"php": ">=7.0",
"php": "^8.0",
"composer/installers": "~1.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^2.12"
"friendsofphp/php-cs-fixer": "^3.13"
},
"extra": {
"branch-alias": {
"dev-master": "4.0.x-dev"
}
},
"minimum-stability": "dev",
"prefer-stable": true
"prefer-stable": true,
"config": {
"allow-plugins": {
"composer/installers": false
}
}
}
2 changes: 1 addition & 1 deletion Modules/Media/Image/Imagy.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ private function writeImage($filename, Stream $image)
$resource = $image->detach();
$config = [
'visibility' => 'public',
'mimetype' => \GuzzleHttp\Psr7\mimetype_from_filename($filename),
'mimetype' => \GuzzleHttp\Psr7\MimeType::fromFilename($filename),
];
if ($this->fileExists($filename)) {
return $this->filesystem->disk($this->getConfiguredFilesystem())->updateStream($filename, $resource, $config);
Expand Down
3 changes: 2 additions & 1 deletion Modules/Media/Tests/ThumbnailsManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Modules\Media\Tests;

use Modules\Media\Image\ThumbnailManager;
use Modules\Media\Tests\MediaTestCase;

class ThumbnailsManagerTest extends MediaTestCase
{
Expand All @@ -11,7 +12,7 @@ class ThumbnailsManagerTest extends MediaTestCase
*/
private $thumbnailManager;

public function setUp(): void
public function setUp()
{
parent::setUp();
$this->thumbnailManager = app(ThumbnailManager::class);
Expand Down
26 changes: 16 additions & 10 deletions Modules/Media/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,26 @@
"source": "https://github.com/AsgardCms/Media"
},
"require": {
"php": "^7.1.3",
"php": "^8.0",
"composer/installers": "~1.0",
"intervention/image": "^2.5",
"idavoll/tag-module": "4.0.x-dev",
"guzzlehttp/psr7": "^1.3"
"intervention/image": "^2.7",
"idavoll/tag-module": "dev-master",
"guzzlehttp/psr7": "^2.4"
},
"require-dev": {
"phpunit/phpunit": "~7.0",
"orchestra/testbench": "3.8.*",
"league/flysystem-aws-s3-v3": "~1.0",
"mockery/mockery": "^0.9.5",
"friendsofphp/php-cs-fixer": "^2.12",
"doctrine/dbal": "^2.11"
"phpunit/phpunit": "~9.5",
"orchestra/testbench": "~7.16",
"league/flysystem-aws-s3-v3": "~3.10",
"mockery/mockery": "^1.5.1",
"friendsofphp/php-cs-fixer": "~3.13",
"doctrine/dbal": "^3.5"
},
"repositories": [
{
"type": "git",
"url": "https://github.com/varshaaweblabs/Idavoll-Tag"
}
],
"autoload-dev": {
"psr-4": {
"Modules\\Media\\": ".",
Expand Down
25 changes: 17 additions & 8 deletions Modules/Menu/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,27 @@
"source": "https://github.com/AsgardCms/Menu"
},
"require": {
"php": "^7.1.3",
"php": "^8.0",
"composer/installers": "~1.0",
"nwidart/laravel-menus": "^7.0",
"typicms/nestablecollection": "^1.1"
"nwidart/laravel-menus": "dev-master",
"typicms/nestablecollection": "~2.0"
},
"require-dev": {
"phpunit/phpunit": "~7.0",
"orchestra/testbench": "3.8.*",
"fzaninotto/faker": "1.4.0",
"doctrine/dbal": "^2.11",
"idavoll/page-module": "4.0.x-dev"
"phpunit/phpunit": "~9.5",
"orchestra/testbench": "~7.16",
"doctrine/dbal": "~3.5",
"idavoll/page-module": "dev-master"
},
"repositories": [
{
"type": "git",
"url": "https://github.com/dineshsailor/nWidart-laravel-menus"
},
{
"type": "git",
"url": "https://github.com/varshaaweblabs/Idavoll-Page"
}
],
"autoload-dev": {
"psr-4": {
"Modules\\Menu\\": ".",
Expand Down
14 changes: 10 additions & 4 deletions Modules/Page/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,20 @@
"source": "https://github.com/AsgardCms/Page"
},
"require": {
"php": "^7.1.3",
"php": "^8.0",
"composer/installers": "~1.0",
"idavoll/tag-module": "4.0.x-dev"
"idavoll/tag-module": "dev-master"
},
"require-dev": {
"phpunit/phpunit": "~7.0",
"orchestra/testbench": "3.8.*"
"phpunit/phpunit": "~9.5",
"orchestra/testbench": "~7.16"
},
"repositories": [
{
"type": "git",
"url": "https://github.com/dineshsailor/Idavoll-Tag"
}
],
"autoload-dev": {
"psr-4": {
"Modules\\Page\\": ".",
Expand Down
15 changes: 10 additions & 5 deletions Modules/Setting/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
"source": "https://github.com/AsgardCms/Setting"
},
"require": {
"php": "^7.1.3",
"php": "^8.0",
"composer/installers": "~1.0",
"doctrine/dbal": "^2.11"
"doctrine/dbal": "^3.5.1"
},
"require-dev": {
"phpunit/phpunit": "~7.0",
"orchestra/testbench": "3.8.*"
"phpunit/phpunit": "~9.5",
"orchestra/testbench": "~7.16"
},
"autoload-dev": {
"psr-4": {
Expand All @@ -40,5 +40,10 @@
}
},
"minimum-stability": "dev",
"prefer-stable": true
"prefer-stable": true,
"config": {
"allow-plugins": {
"composer/installers": false
}
}
}
14 changes: 10 additions & 4 deletions Modules/Tag/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,20 @@
}
],
"require": {
"php": "^7.1.3",
"php": "^8.0",
"composer/installers": "~1.0"
},
"require-dev": {
"phpunit/phpunit": "~7.0",
"orchestra/testbench": "3.8.*",
"idavoll/page-module": "4.0.x-dev"
"phpunit/phpunit": "~9.5",
"orchestra/testbench": "~7.16",
"idavoll/page-module": "dev-master"
},
"repositories": [
{
"type": "git",
"url": "https://github.com/dineshsailor/Idavoll-Page"
}
],
"autoload": {
"psr-4": {
"Modules\\Tag\\": ""
Expand Down
17 changes: 9 additions & 8 deletions Modules/Translation/Importers/TranslationsImporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

use Illuminate\Support\Arr;
use League\Csv\Reader;
use League\Csv\Statement;
use function League\Csv\delimiter_detect;
use Modules\Translation\Repositories\TranslationRepository;
use Symfony\Component\HttpFoundation\File\UploadedFile;

Expand All @@ -21,12 +23,13 @@ public function __construct(TranslationRepository $translation)

public function import(UploadedFile $file)
{
$csv = Reader::createFromPath($file->getRealPath());
$csv->detectDelimiterList(5, [',', ';']);
$csv = Reader::createFromPath($file->getRealPath(), 'r');
delimiter_detect($csv, [',', ';', "\t"], 10);
$headers = $csv->fetchOne();
$csv->setOffset(1);

$csv->each(function ($row) use ($headers) {
$stmt = Statement::create()->offset(1);
$records = $stmt->process($csv);
foreach ($records as $offset => $row) {
try {
$row = array_combine($headers, $row);
} catch (\Exception $e) {
Expand All @@ -35,14 +38,12 @@ public function import(UploadedFile $file)

$key = Arr::get($row, 'key');
array_shift($row);

$data = [];
foreach ($row as $locale => $value) {
$data[$locale] = ['value' => $value];
}

$this->translation->updateFromImport($key, $data);

return true;
});
}
}
}
17 changes: 11 additions & 6 deletions Modules/Translation/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
"type": "asgard-module",
"license": "MIT",
"require": {
"php": "^7.1.3",
"php": "^8.0",
"composer/installers": "~1.0",
"league/csv": "~7.2.0",
"venturecraft/revisionable": "^1.35"
"league/csv": "~9.8.0",
"venturecraft/revisionable": "^1.39"
},
"require-dev": {
"phpunit/phpunit": "~7.0",
"orchestra/testbench": "3.8.*"
"phpunit/phpunit": "~9.5",
"orchestra/testbench": "~v7.16"
},
"autoload": {
"psr-4": {
Expand All @@ -36,5 +36,10 @@
}
},
"minimum-stability": "dev",
"prefer-stable": true
"prefer-stable": true,
"config": {
"allow-plugins": {
"composer/installers": false
}
}
}
Loading