From 8651bc6c9bedd16c81d7b645d5d86f37e1299c30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Denis=20Duli=C3=A7i?= Date: Sat, 8 May 2021 19:09:55 +0300 Subject: [PATCH] updated mediable package --- app/Listeners/Update/V21/Version2112.php | 3 + composer.json | 2 +- composer.lock | 142 +++++++++--------- config/mediable.php | 31 ++-- .../migrations/2017_09_14_000000_core_v1.php | 26 +--- 5 files changed, 98 insertions(+), 106 deletions(-) diff --git a/app/Listeners/Update/V21/Version2112.php b/app/Listeners/Update/V21/Version2112.php index 51f1346eb..d1e3be5f0 100644 --- a/app/Listeners/Update/V21/Version2112.php +++ b/app/Listeners/Update/V21/Version2112.php @@ -7,6 +7,7 @@ use App\Events\Install\UpdateFinished as Event; use App\Models\Common\Company; use App\Models\Common\Media; use App\Utilities\Date; +use Illuminate\Support\Facades\Artisan; use Illuminate\Support\Facades\File; use Illuminate\Support\Facades\Storage; @@ -28,6 +29,8 @@ class Version2112 extends Listener return; } + Artisan::call('migrate', ['--force' => true]); + $this->updateCompanies(); } diff --git a/composer.json b/composer.json index 2d82a0ee0..d7f6d93bb 100644 --- a/composer.json +++ b/composer.json @@ -53,7 +53,7 @@ "maatwebsite/excel": "3.1.*", "mnsami/composer-custom-directory-installer": "2.0.*", "monooso/unobserve": "^3.0", - "plank/laravel-mediable": "4.4.*", + "plank/laravel-mediable": "^5.1", "riverskies/laravel-mobile-detect": "^1.3", "santigarcor/laratrust": "6.3.*", "simshaun/recurr": "4.0.*", diff --git a/composer.lock b/composer.lock index 7e57910d7..30518f1a1 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "369729efd317a8b64e40995b4e24ea4f", + "content-hash": "0f9d8ca997b25292972d0b41575258a6", "packages": [ { "name": "akaunting/laravel-firewall", @@ -2750,16 +2750,16 @@ }, { "name": "enlightn/enlightn", - "version": "v1.22.0", + "version": "v1.22.1", "source": { "type": "git", "url": "https://github.com/enlightn/enlightn.git", - "reference": "0958011684210838bb50646bedd6a33f73994e7c" + "reference": "b4743d1abbcaf8340729a9cada2cceced33ff2c6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/enlightn/enlightn/zipball/0958011684210838bb50646bedd6a33f73994e7c", - "reference": "0958011684210838bb50646bedd6a33f73994e7c", + "url": "https://api.github.com/repos/enlightn/enlightn/zipball/b4743d1abbcaf8340729a9cada2cceced33ff2c6", + "reference": "b4743d1abbcaf8340729a9cada2cceced33ff2c6", "shasum": "" }, "require": { @@ -2808,6 +2808,10 @@ { "name": "Miguel Piedrafita", "email": "soy@miguelpiedrafita.com" + }, + { + "name": "Lars Klopstra", + "email": "lars@flowframe.nl" } ], "description": "Enlightn - Your performance & security consultant, an artisan command away.", @@ -2827,22 +2831,22 @@ "support": { "docs": "https://www.laravel-enlightn.com/docs/", "issues": "https://github.com/enlightn/enlightn/issues", - "source": "https://github.com/enlightn/enlightn/tree/v1.22.0" + "source": "https://github.com/enlightn/enlightn/tree/v1.22.1" }, - "time": "2021-04-15T15:05:41+00:00" + "time": "2021-05-03T07:32:51+00:00" }, { "name": "enlightn/security-checker", - "version": "v1.8.0", + "version": "v1.9.0", "source": { "type": "git", "url": "https://github.com/enlightn/security-checker.git", - "reference": "2054fbce2f8df681c8f71b36656222bcd241b77f" + "reference": "dc5bce653fa4d9c792e9dcffa728c0642847c1e1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/enlightn/security-checker/zipball/2054fbce2f8df681c8f71b36656222bcd241b77f", - "reference": "2054fbce2f8df681c8f71b36656222bcd241b77f", + "url": "https://api.github.com/repos/enlightn/security-checker/zipball/dc5bce653fa4d9c792e9dcffa728c0642847c1e1", + "reference": "dc5bce653fa4d9c792e9dcffa728c0642847c1e1", "shasum": "" }, "require": { @@ -2893,9 +2897,9 @@ ], "support": { "issues": "https://github.com/enlightn/security-checker/issues", - "source": "https://github.com/enlightn/security-checker/tree/v1.8.0" + "source": "https://github.com/enlightn/security-checker/tree/v1.9.0" }, - "time": "2021-04-19T07:13:16+00:00" + "time": "2021-05-06T09:03:35+00:00" }, { "name": "ezyang/htmlpurifier", @@ -5401,16 +5405,16 @@ }, { "name": "league/commonmark", - "version": "1.5.8", + "version": "1.6.0", "source": { "type": "git", "url": "https://github.com/thephpleague/commonmark.git", - "reference": "08fa59b8e4e34ea8a773d55139ae9ac0e0aecbaf" + "reference": "19a9673b833cc37770439097b381d86cd125bfe8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/commonmark/zipball/08fa59b8e4e34ea8a773d55139ae9ac0e0aecbaf", - "reference": "08fa59b8e4e34ea8a773d55139ae9ac0e0aecbaf", + "url": "https://api.github.com/repos/thephpleague/commonmark/zipball/19a9673b833cc37770439097b381d86cd125bfe8", + "reference": "19a9673b833cc37770439097b381d86cd125bfe8", "shasum": "" }, "require": { @@ -5498,7 +5502,7 @@ "type": "tidelift" } ], - "time": "2021-03-28T18:51:39+00:00" + "time": "2021-05-01T19:00:49+00:00" }, { "name": "league/flysystem", @@ -6856,16 +6860,16 @@ }, { "name": "nesbot/carbon", - "version": "2.46.0", + "version": "2.47.0", "source": { "type": "git", "url": "https://github.com/briannesbitt/Carbon.git", - "reference": "2fd2c4a77d58a4e95234c8a61c5df1f157a91bf4" + "reference": "606262fd8888b75317ba9461825a24fc34001e1e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/2fd2c4a77d58a4e95234c8a61c5df1f157a91bf4", - "reference": "2fd2c4a77d58a4e95234c8a61c5df1f157a91bf4", + "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/606262fd8888b75317ba9461825a24fc34001e1e", + "reference": "606262fd8888b75317ba9461825a24fc34001e1e", "shasum": "" }, "require": { @@ -6945,20 +6949,20 @@ "type": "tidelift" } ], - "time": "2021-02-24T17:30:44+00:00" + "time": "2021-04-13T21:54:02+00:00" }, { "name": "nikic/php-parser", - "version": "v4.10.4", + "version": "v4.10.5", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "c6d052fc58cb876152f89f532b95a8d7907e7f0e" + "reference": "4432ba399e47c66624bc73c8c0f811e5c109576f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/c6d052fc58cb876152f89f532b95a8d7907e7f0e", - "reference": "c6d052fc58cb876152f89f532b95a8d7907e7f0e", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/4432ba399e47c66624bc73c8c0f811e5c109576f", + "reference": "4432ba399e47c66624bc73c8c0f811e5c109576f", "shasum": "" }, "require": { @@ -6999,9 +7003,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.10.4" + "source": "https://github.com/nikic/PHP-Parser/tree/v4.10.5" }, - "time": "2020-12-20T10:01:03+00:00" + "time": "2021-05-03T19:11:20+00:00" }, { "name": "nunomaduro/larastan", @@ -8094,16 +8098,16 @@ }, { "name": "phpstan/phpstan", - "version": "0.12.85", + "version": "0.12.86", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "20e6333c0067875ad7697cd8acdf245c6ef69d03" + "reference": "a84fdc53ecca7643dbc89ef8880d8b393a6c155a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/20e6333c0067875ad7697cd8acdf245c6ef69d03", - "reference": "20e6333c0067875ad7697cd8acdf245c6ef69d03", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/a84fdc53ecca7643dbc89ef8880d8b393a6c155a", + "reference": "a84fdc53ecca7643dbc89ef8880d8b393a6c155a", "shasum": "" }, "require": { @@ -8134,7 +8138,7 @@ "description": "PHPStan - PHP Static Analysis Tool", "support": { "issues": "https://github.com/phpstan/phpstan/issues", - "source": "https://github.com/phpstan/phpstan/tree/0.12.85" + "source": "https://github.com/phpstan/phpstan/tree/0.12.86" }, "funding": [ { @@ -8150,41 +8154,44 @@ "type": "tidelift" } ], - "time": "2021-04-27T14:13:16+00:00" + "time": "2021-05-08T11:29:01+00:00" }, { "name": "plank/laravel-mediable", - "version": "4.4.2", + "version": "5.1.1", "source": { "type": "git", "url": "https://github.com/plank/laravel-mediable.git", - "reference": "c52785afc1b57c517b3bf092692484264b081cb8" + "reference": "c26f8b3ebb2e1d3db8202dec83b3135f77ec4b88" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/plank/laravel-mediable/zipball/c52785afc1b57c517b3bf092692484264b081cb8", - "reference": "c52785afc1b57c517b3bf092692484264b081cb8", + "url": "https://api.github.com/repos/plank/laravel-mediable/zipball/c26f8b3ebb2e1d3db8202dec83b3135f77ec4b88", + "reference": "c26f8b3ebb2e1d3db8202dec83b3135f77ec4b88", "shasum": "" }, "require": { "ext-fileinfo": "*", + "guzzlehttp/guzzle": "^6.5|^7.1", "illuminate/database": ">6.0", "illuminate/filesystem": ">6.0", "illuminate/support": ">6.0", + "intervention/image": "^2.5", "league/flysystem": "^1.0.23", "php": ">=7.3.0", "psr/http-message": "^1.0" }, "require-dev": { - "aws/aws-sdk-php": "^3.128.1", - "guzzlehttp/guzzle": "^6.3", - "guzzlehttp/promises": "^1.3", + "aws/aws-sdk-php": "^3.166.0", + "doctrine/dbal": "^2.11", + "guzzlehttp/promises": "^1.4", "laravel/legacy-factories": "^1.0.4", "league/flysystem-aws-s3-v3": "^1.0.23", - "orchestra/testbench": "^3.3|^4.0|^5.0|^6.0", - "php-coveralls/php-coveralls": "^2.1", - "phpunit/phpunit": "^8.2.4|^9.0", - "vlucas/phpdotenv": "^3.3|^4.0|^5.0" + "mockery/mockery": "^1.4.2", + "orchestra/testbench": "^5.9|^6.6", + "php-coveralls/php-coveralls": "^2.4", + "phpunit/phpunit": "^9.5", + "vlucas/phpdotenv": "^4.0|^5.0" }, "type": "library", "extra": { @@ -8193,7 +8200,8 @@ "Plank\\Mediable\\MediableServiceProvider" ], "aliases": { - "MediaUploader": "Plank\\Mediable\\MediaUploaderFacade" + "MediaUploader": "Plank\\Mediable\\Facades\\MediaUploader", + "ImageManipulator": "Plank\\Mediable\\Facades\\ImageManipulator" } } }, @@ -8222,9 +8230,9 @@ ], "support": { "issues": "https://github.com/plank/laravel-mediable/issues", - "source": "https://github.com/plank/laravel-mediable/tree/4.4.2" + "source": "https://github.com/plank/laravel-mediable/tree/5.1.1" }, - "time": "2020-09-27T01:55:59+00:00" + "time": "2021-04-30T02:05:55+00:00" }, { "name": "psr/container", @@ -8486,16 +8494,16 @@ }, { "name": "psr/log", - "version": "1.1.3", + "version": "1.1.4", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc" + "reference": "d49695b909c3b7628b6289db5479a1c204601f11" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/0f73288fd15629204f9d42b7055f72dacbe811fc", - "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc", + "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11", + "reference": "d49695b909c3b7628b6289db5479a1c204601f11", "shasum": "" }, "require": { @@ -8519,7 +8527,7 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "description": "Common interface for logging libraries", @@ -8530,9 +8538,9 @@ "psr-3" ], "support": { - "source": "https://github.com/php-fig/log/tree/1.1.3" + "source": "https://github.com/php-fig/log/tree/1.1.4" }, - "time": "2020-03-23T09:12:05+00:00" + "time": "2021-05-03T11:20:27+00:00" }, { "name": "psr/simple-cache", @@ -12465,16 +12473,16 @@ }, { "name": "facade/ignition", - "version": "2.8.4", + "version": "2.9.0", "source": { "type": "git", "url": "https://github.com/facade/ignition.git", - "reference": "87fb348dab0ae1a7c206c3e902a5a44ba541742f" + "reference": "e7db3b601ce742568b92648818ef903904d20164" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/facade/ignition/zipball/87fb348dab0ae1a7c206c3e902a5a44ba541742f", - "reference": "87fb348dab0ae1a7c206c3e902a5a44ba541742f", + "url": "https://api.github.com/repos/facade/ignition/zipball/e7db3b601ce742568b92648818ef903904d20164", + "reference": "e7db3b601ce742568b92648818ef903904d20164", "shasum": "" }, "require": { @@ -12538,7 +12546,7 @@ "issues": "https://github.com/facade/ignition/issues", "source": "https://github.com/facade/ignition" }, - "time": "2021-04-29T13:55:26+00:00" + "time": "2021-05-05T06:45:12+00:00" }, { "name": "facade/ignition-contracts", @@ -14551,16 +14559,16 @@ }, { "name": "wnx/laravel-stats", - "version": "v2.5.1", + "version": "v2.5.2", "source": { "type": "git", "url": "https://github.com/stefanzweifel/laravel-stats.git", - "reference": "689408202f77cad97664458dcd6c59f9142dbdd7" + "reference": "3bb622cb20a8c17d3d8fe9429e02df3f4d43ee81" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/stefanzweifel/laravel-stats/zipball/689408202f77cad97664458dcd6c59f9142dbdd7", - "reference": "689408202f77cad97664458dcd6c59f9142dbdd7", + "url": "https://api.github.com/repos/stefanzweifel/laravel-stats/zipball/3bb622cb20a8c17d3d8fe9429e02df3f4d43ee81", + "reference": "3bb622cb20a8c17d3d8fe9429e02df3f4d43ee81", "shasum": "" }, "require": { @@ -14618,7 +14626,7 @@ ], "support": { "issues": "https://github.com/stefanzweifel/laravel-stats/issues", - "source": "https://github.com/stefanzweifel/laravel-stats/tree/v2.5.1" + "source": "https://github.com/stefanzweifel/laravel-stats/tree/v2.5.2" }, "funding": [ { @@ -14630,7 +14638,7 @@ "type": "github" } ], - "time": "2021-03-11T18:36:42+00:00" + "time": "2021-05-02T09:40:29+00:00" } ], "aliases": [], diff --git a/config/mediable.php b/config/mediable.php index 1e4ad4703..7ff3f9bab 100644 --- a/config/mediable.php +++ b/config/mediable.php @@ -6,7 +6,12 @@ return [ * * Should extend `Plank\Mediable\Media` */ - 'model' => env('MEDIABLE_MODEL', 'Plank\Mediable\Media'), + 'model' => env('MEDIABLE_MODEL', App\Models\Common\Media::class), + + /* + * Name to be used for mediables joining table + */ + 'mediables_table' => env('MEDIABLE_TABLE', 'mediables'), /* * Filesystem disk to use if none is specified @@ -151,7 +156,7 @@ return [ 'text/json', 'application/json', 'application/msword', - 'application/application/vnd.openxmlformats-officedocument.wordprocessingml.document' + 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' ], 'extensions' => [ 'doc', @@ -174,17 +179,17 @@ return [ ], Plank\Mediable\Media::TYPE_PRESENTATION => [ 'mime_types' => - [ - 'application/vnd.ms-powerpoint', - 'application/vnd.openxmlformats-officedocument.presentationml.presentation', - 'application/vnd.openxmlformats-officedocument.presentationml.slideshow' - ], + [ + 'application/vnd.ms-powerpoint', + 'application/vnd.openxmlformats-officedocument.presentationml.presentation', + 'application/vnd.openxmlformats-officedocument.presentationml.slideshow' + ], 'extensions' => - [ - 'ppt', - 'pptx', - 'ppsx', - ] + [ + 'ppt', + 'pptx', + 'ppsx', + ] ], ], @@ -202,7 +207,7 @@ return [ 'pattern' => [ '^https?://' => Plank\Mediable\SourceAdapters\RemoteUrlAdapter::class, '^/' => Plank\Mediable\SourceAdapters\LocalPathAdapter::class, - '^[a-zA-Z]:\\' => Plank\Mediable\SourceAdapters\LocalPathAdapter::class + '^[a-zA-Z]:\\\\' => Plank\Mediable\SourceAdapters\LocalPathAdapter::class ], ], diff --git a/database/migrations/2017_09_14_000000_core_v1.php b/database/migrations/2017_09_14_000000_core_v1.php index 316bb6745..613eb8e28 100644 --- a/database/migrations/2017_09_14_000000_core_v1.php +++ b/database/migrations/2017_09_14_000000_core_v1.php @@ -311,37 +311,13 @@ class CoreV1 extends Migration }); // Media - Schema::create('media', function (Blueprint $table) { - $table->increments('id'); - $table->string('disk', 32); - $table->string('directory', 68); - $table->string('filename', 121); - $table->string('extension', 28); - $table->string('mime_type', 128); - $table->string('aggregate_type', 32); - $table->integer('size')->unsigned(); - $table->timestamps(); + Schema::table('media', function (Blueprint $table) { $table->softDeletes(); $table->index(['disk', 'directory']); - $table->index('aggregate_type'); $table->unique(['disk', 'directory', 'filename', 'extension', 'deleted_at']); }); - Schema::create('mediables', function (Blueprint $table) { - $table->integer('media_id')->unsigned(); - $table->string('mediable_type', 152); - $table->integer('mediable_id')->unsigned(); - $table->string('tag', 68); - $table->integer('order')->unsigned(); - - $table->primary(['media_id', 'mediable_type', 'mediable_id', 'tag']); - $table->index(['mediable_id', 'mediable_type']); - $table->index('tag'); - $table->index('order'); - $table->foreign('media_id')->references('id')->on('media')->onDelete('cascade'); - }); - // Modules Schema::create('modules', function (Blueprint $table) { $table->increments('id');