diff --git a/composer.json b/composer.json index 23a3a2db..64ec0aac 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,6 @@ "php": "^8.0.2", "ext-json": "*", "ext-pdo": "*", - "beyondcode/laravel-websockets": "^1.13", "brianium/paratest": "^6.4.1", "cocur/slugify": "^4.1", "doctrine/dbal": "^2.13.7", @@ -24,14 +23,11 @@ "laravel/fortify": "^1.12.0", "laravel/framework": "^9.2", "laravel/sanctum": "^2.14.2", - "laravel/socialite": "^5.5.1", "laravel/tinker": "^2.7", "laravel/ui": "^3.4.2", "league/flysystem-aws-s3-v3": "^3.0.9", "league/flysystem-ftp": "^3.0", - "makingcg/subscription": "^1.0.5", "matthewbdaly/laravel-azure-storage": "^2.0", - "pusher/pusher-php-server": "^7.0", "spatie/data-transfer-object": "^3.7.3", "spatie/laravel-backup": "^8.0.8", "spatie/laravel-query-builder": "^5.0.0", @@ -55,12 +51,6 @@ "fakerphp/faker": "^1.19.0", "ext-json": "*" }, - "repositories": [ - { - "type": "vcs", - "url": "https://github.com/VueFileManager/subscription.git" - } - ], "config": { "optimize-autoloader": true, "preferred-install": "dist", diff --git a/composer.lock b/composer.lock index 7ecd8492..1ca6f9c4 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": "da78385bb0354b117852966eab7e288c", + "content-hash": "b158e283d8d7a147ea80a0b1e759835a", "packages": [ { "name": "amphp/amp", @@ -280,16 +280,16 @@ }, { "name": "aws/aws-sdk-php", - "version": "3.220.0", + "version": "3.220.4", "source": { "type": "git", "url": "https://github.com/aws/aws-sdk-php.git", - "reference": "8beb098a2224742b2756e3b40a07593b1e6ff967" + "reference": "6c2e36bb61741c87ed7ffd53e15d903311ad6b60" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/8beb098a2224742b2756e3b40a07593b1e6ff967", - "reference": "8beb098a2224742b2756e3b40a07593b1e6ff967", + "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/6c2e36bb61741c87ed7ffd53e15d903311ad6b60", + "reference": "6c2e36bb61741c87ed7ffd53e15d903311ad6b60", "shasum": "" }, "require": { @@ -365,9 +365,9 @@ "support": { "forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80", "issues": "https://github.com/aws/aws-sdk-php/issues", - "source": "https://github.com/aws/aws-sdk-php/tree/3.220.0" + "source": "https://github.com/aws/aws-sdk-php/tree/3.220.4" }, - "time": "2022-04-19T18:17:15+00:00" + "time": "2022-04-25T18:16:08+00:00" }, { "name": "bacon/bacon-qr-code", @@ -423,88 +423,6 @@ }, "time": "2022-03-14T02:02:36+00:00" }, - { - "name": "beyondcode/laravel-websockets", - "version": "1.13.1", - "source": { - "type": "git", - "url": "https://github.com/beyondcode/laravel-websockets.git", - "reference": "f0649b65fb5562d20eff66f61716ef98717e228a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/beyondcode/laravel-websockets/zipball/f0649b65fb5562d20eff66f61716ef98717e228a", - "reference": "f0649b65fb5562d20eff66f61716ef98717e228a", - "shasum": "" - }, - "require": { - "cboden/ratchet": "^0.4.1", - "ext-json": "*", - "facade/ignition-contracts": "^1.0", - "guzzlehttp/psr7": "^1.7|^2.0", - "illuminate/broadcasting": "^6.0|^7.0|^8.0|^9.0", - "illuminate/console": "^6.0|^7.0|^8.0|^9.0", - "illuminate/http": "^6.0|^7.0|^8.0|^9.0", - "illuminate/routing": "^6.0|^7.0|^8.0|^9.0", - "illuminate/support": "^6.0|^7.0|^8.0|^9.0", - "php": "^7.2|^8.0", - "pusher/pusher-php-server": "^3.0|^4.0|^5.0|^6.0|^7.0", - "react/dns": "^1.1", - "react/http": "^1.1", - "symfony/http-kernel": "^4.0|^5.0|^6.0", - "symfony/psr-http-message-bridge": "^1.1|^2.0" - }, - "require-dev": { - "mockery/mockery": "^1.3.3", - "orchestra/testbench": "^4.0|^5.0|^6.0", - "phpunit/phpunit": "^8.0|^9.0" - }, - "type": "library", - "extra": { - "laravel": { - "providers": [ - "BeyondCode\\LaravelWebSockets\\WebSocketsServiceProvider" - ], - "aliases": { - "WebSocketRouter": "BeyondCode\\LaravelWebSockets\\Facades\\WebSocketRouter" - } - } - }, - "autoload": { - "psr-4": { - "BeyondCode\\LaravelWebSockets\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marcel Pociot", - "email": "marcel@beyondco.de", - "homepage": "https://beyondcode.de", - "role": "Developer" - }, - { - "name": "Freek Van der Herten", - "email": "freek@spatie.be", - "homepage": "https://spatie.be", - "role": "Developer" - } - ], - "description": "An easy to use WebSocket server", - "homepage": "https://github.com/beyondcode/laravel-websockets", - "keywords": [ - "beyondcode", - "laravel-websockets" - ], - "support": { - "issues": "https://github.com/beyondcode/laravel-websockets/issues", - "source": "https://github.com/beyondcode/laravel-websockets/tree/1.13.1" - }, - "time": "2022-03-03T08:41:47+00:00" - }, { "name": "brianium/paratest", "version": "v6.4.4", @@ -653,69 +571,6 @@ ], "time": "2021-08-15T20:50:18+00:00" }, - { - "name": "cboden/ratchet", - "version": "v0.4.4", - "source": { - "type": "git", - "url": "https://github.com/ratchetphp/Ratchet.git", - "reference": "5012dc954541b40c5599d286fd40653f5716a38f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/ratchetphp/Ratchet/zipball/5012dc954541b40c5599d286fd40653f5716a38f", - "reference": "5012dc954541b40c5599d286fd40653f5716a38f", - "shasum": "" - }, - "require": { - "guzzlehttp/psr7": "^1.7|^2.0", - "php": ">=5.4.2", - "ratchet/rfc6455": "^0.3.1", - "react/event-loop": ">=0.4", - "react/socket": "^1.0 || ^0.8 || ^0.7 || ^0.6 || ^0.5", - "symfony/http-foundation": "^2.6|^3.0|^4.0|^5.0|^6.0", - "symfony/routing": "^2.6|^3.0|^4.0|^5.0|^6.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.8" - }, - "type": "library", - "autoload": { - "psr-4": { - "Ratchet\\": "src/Ratchet" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Chris Boden", - "email": "cboden@gmail.com", - "role": "Developer" - }, - { - "name": "Matt Bonneau", - "role": "Developer" - } - ], - "description": "PHP WebSocket library", - "homepage": "http://socketo.me", - "keywords": [ - "Ratchet", - "WebSockets", - "server", - "sockets", - "websocket" - ], - "support": { - "chat": "https://gitter.im/reactphp/reactphp", - "issues": "https://github.com/ratchetphp/Ratchet/issues", - "source": "https://github.com/ratchetphp/Ratchet/tree/v0.4.4" - }, - "time": "2021-12-14T00:20:41+00:00" - }, { "name": "cocur/slugify", "version": "v4.1.0", @@ -1240,78 +1095,6 @@ }, "time": "2019-12-04T15:06:13+00:00" }, - { - "name": "doctrine/annotations", - "version": "1.13.2", - "source": { - "type": "git", - "url": "https://github.com/doctrine/annotations.git", - "reference": "5b668aef16090008790395c02c893b1ba13f7e08" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/annotations/zipball/5b668aef16090008790395c02c893b1ba13f7e08", - "reference": "5b668aef16090008790395c02c893b1ba13f7e08", - "shasum": "" - }, - "require": { - "doctrine/lexer": "1.*", - "ext-tokenizer": "*", - "php": "^7.1 || ^8.0", - "psr/cache": "^1 || ^2 || ^3" - }, - "require-dev": { - "doctrine/cache": "^1.11 || ^2.0", - "doctrine/coding-standard": "^6.0 || ^8.1", - "phpstan/phpstan": "^0.12.20", - "phpunit/phpunit": "^7.5 || ^8.0 || ^9.1.5", - "symfony/cache": "^4.4 || ^5.2" - }, - "type": "library", - "autoload": { - "psr-4": { - "Doctrine\\Common\\Annotations\\": "lib/Doctrine/Common/Annotations" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "description": "Docblock Annotations Parser", - "homepage": "https://www.doctrine-project.org/projects/annotations.html", - "keywords": [ - "annotations", - "docblock", - "parser" - ], - "support": { - "issues": "https://github.com/doctrine/annotations/issues", - "source": "https://github.com/doctrine/annotations/tree/1.13.2" - }, - "time": "2021-08-05T19:00:23+00:00" - }, { "name": "doctrine/cache", "version": "2.1.1", @@ -2023,106 +1806,6 @@ ], "time": "2021-10-11T09:18:27+00:00" }, - { - "name": "evenement/evenement", - "version": "v3.0.1", - "source": { - "type": "git", - "url": "https://github.com/igorw/evenement.git", - "reference": "531bfb9d15f8aa57454f5f0285b18bec903b8fb7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/igorw/evenement/zipball/531bfb9d15f8aa57454f5f0285b18bec903b8fb7", - "reference": "531bfb9d15f8aa57454f5f0285b18bec903b8fb7", - "shasum": "" - }, - "require": { - "php": ">=7.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.0" - }, - "type": "library", - "autoload": { - "psr-0": { - "Evenement": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Igor Wiedler", - "email": "igor@wiedler.ch" - } - ], - "description": "Événement is a very simple event dispatching library for PHP", - "keywords": [ - "event-dispatcher", - "event-emitter" - ], - "support": { - "issues": "https://github.com/igorw/evenement/issues", - "source": "https://github.com/igorw/evenement/tree/master" - }, - "time": "2017-07-23T21:35:13+00:00" - }, - { - "name": "facade/ignition-contracts", - "version": "1.0.2", - "source": { - "type": "git", - "url": "https://github.com/facade/ignition-contracts.git", - "reference": "3c921a1cdba35b68a7f0ccffc6dffc1995b18267" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/facade/ignition-contracts/zipball/3c921a1cdba35b68a7f0ccffc6dffc1995b18267", - "reference": "3c921a1cdba35b68a7f0ccffc6dffc1995b18267", - "shasum": "" - }, - "require": { - "php": "^7.3|^8.0" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "^v2.15.8", - "phpunit/phpunit": "^9.3.11", - "vimeo/psalm": "^3.17.1" - }, - "type": "library", - "autoload": { - "psr-4": { - "Facade\\IgnitionContracts\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Freek Van der Herten", - "email": "freek@spatie.be", - "homepage": "https://flareapp.io", - "role": "Developer" - } - ], - "description": "Solution contracts for Ignition", - "homepage": "https://github.com/facade/ignition-contracts", - "keywords": [ - "contracts", - "flare", - "ignition" - ], - "support": { - "issues": "https://github.com/facade/ignition-contracts/issues", - "source": "https://github.com/facade/ignition-contracts/tree/1.0.2" - }, - "time": "2020-10-16T08:27:54+00:00" - }, { "name": "felixfbecker/advanced-json-rpc", "version": "v3.2.1", @@ -2224,151 +1907,6 @@ }, "time": "2022-03-02T22:36:06+00:00" }, - { - "name": "fig/http-message-util", - "version": "1.1.5", - "source": { - "type": "git", - "url": "https://github.com/php-fig/http-message-util.git", - "reference": "9d94dc0154230ac39e5bf89398b324a86f63f765" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-message-util/zipball/9d94dc0154230ac39e5bf89398b324a86f63f765", - "reference": "9d94dc0154230ac39e5bf89398b324a86f63f765", - "shasum": "" - }, - "require": { - "php": "^5.3 || ^7.0 || ^8.0" - }, - "suggest": { - "psr/http-message": "The package containing the PSR-7 interfaces" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Fig\\Http\\Message\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "Utility classes and constants for use with PSR-7 (psr/http-message)", - "keywords": [ - "http", - "http-message", - "psr", - "psr-7", - "request", - "response" - ], - "support": { - "issues": "https://github.com/php-fig/http-message-util/issues", - "source": "https://github.com/php-fig/http-message-util/tree/1.1.5" - }, - "time": "2020-11-24T22:02:12+00:00" - }, - { - "name": "friendsofphp/php-cs-fixer", - "version": "v3.8.0", - "source": { - "type": "git", - "url": "https://github.com/FriendsOfPHP/PHP-CS-Fixer.git", - "reference": "cbad1115aac4b5c3c5540e7210d3c9fba2f81fa3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/cbad1115aac4b5c3c5540e7210d3c9fba2f81fa3", - "reference": "cbad1115aac4b5c3c5540e7210d3c9fba2f81fa3", - "shasum": "" - }, - "require": { - "composer/semver": "^3.2", - "composer/xdebug-handler": "^3.0.3", - "doctrine/annotations": "^1.13", - "ext-json": "*", - "ext-tokenizer": "*", - "php": "^7.4 || ^8.0", - "php-cs-fixer/diff": "^2.0", - "symfony/console": "^5.4 || ^6.0", - "symfony/event-dispatcher": "^5.4 || ^6.0", - "symfony/filesystem": "^5.4 || ^6.0", - "symfony/finder": "^5.4 || ^6.0", - "symfony/options-resolver": "^5.4 || ^6.0", - "symfony/polyfill-mbstring": "^1.23", - "symfony/polyfill-php80": "^1.25", - "symfony/polyfill-php81": "^1.25", - "symfony/process": "^5.4 || ^6.0", - "symfony/stopwatch": "^5.4 || ^6.0" - }, - "require-dev": { - "justinrainbow/json-schema": "^5.2", - "keradus/cli-executor": "^1.5", - "mikey179/vfsstream": "^1.6.10", - "php-coveralls/php-coveralls": "^2.5.2", - "php-cs-fixer/accessible-object": "^1.1", - "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.2", - "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.2.1", - "phpspec/prophecy": "^1.15", - "phpspec/prophecy-phpunit": "^2.0", - "phpunit/phpunit": "^9.5", - "phpunitgoodpractices/polyfill": "^1.5", - "phpunitgoodpractices/traits": "^1.9.1", - "symfony/phpunit-bridge": "^6.0", - "symfony/yaml": "^5.4 || ^6.0" - }, - "suggest": { - "ext-dom": "For handling output formats in XML", - "ext-mbstring": "For handling non-UTF8 characters." - }, - "bin": [ - "php-cs-fixer" - ], - "type": "application", - "autoload": { - "psr-4": { - "PhpCsFixer\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Dariusz Rumiński", - "email": "dariusz.ruminski@gmail.com" - } - ], - "description": "A tool to automatically fix PHP code style", - "support": { - "issues": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/issues", - "source": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/tree/v3.8.0" - }, - "funding": [ - { - "url": "https://github.com/keradus", - "type": "github" - } - ], - "time": "2022-03-18T17:20:59+00:00" - }, { "name": "fruitcake/laravel-cors", "version": "v2.2.0", @@ -3663,75 +3201,6 @@ }, "time": "2022-02-11T19:23:53+00:00" }, - { - "name": "laravel/socialite", - "version": "v5.5.2", - "source": { - "type": "git", - "url": "https://github.com/laravel/socialite.git", - "reference": "68afb03259b82d898c68196cbcacd48596a9dd72" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/laravel/socialite/zipball/68afb03259b82d898c68196cbcacd48596a9dd72", - "reference": "68afb03259b82d898c68196cbcacd48596a9dd72", - "shasum": "" - }, - "require": { - "ext-json": "*", - "guzzlehttp/guzzle": "^6.0|^7.0", - "illuminate/http": "^6.0|^7.0|^8.0|^9.0", - "illuminate/support": "^6.0|^7.0|^8.0|^9.0", - "league/oauth1-client": "^1.0", - "php": "^7.2|^8.0" - }, - "require-dev": { - "illuminate/contracts": "^6.0|^7.0|^8.0|^9.0", - "mockery/mockery": "^1.0", - "orchestra/testbench": "^4.0|^5.0|^6.0|^7.0", - "phpunit/phpunit": "^8.0|^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.x-dev" - }, - "laravel": { - "providers": [ - "Laravel\\Socialite\\SocialiteServiceProvider" - ], - "aliases": { - "Socialite": "Laravel\\Socialite\\Facades\\Socialite" - } - } - }, - "autoload": { - "psr-4": { - "Laravel\\Socialite\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "description": "Laravel wrapper around OAuth 1 & OAuth 2 libraries.", - "homepage": "https://laravel.com", - "keywords": [ - "laravel", - "oauth" - ], - "support": { - "issues": "https://github.com/laravel/socialite/issues", - "source": "https://github.com/laravel/socialite" - }, - "time": "2022-03-10T15:26:19+00:00" - }, { "name": "laravel/tinker", "version": "v2.7.2", @@ -4051,16 +3520,16 @@ }, { "name": "league/flysystem", - "version": "3.0.17", + "version": "3.0.18", "source": { "type": "git", "url": "https://github.com/thephpleague/flysystem.git", - "reference": "29eb78cac0be0c22237c5e0f6f98234d97037d79" + "reference": "c8e137e594948240b03372e012344b07c61b9193" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/29eb78cac0be0c22237c5e0f6f98234d97037d79", - "reference": "29eb78cac0be0c22237c5e0f6f98234d97037d79", + "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/c8e137e594948240b03372e012344b07c61b9193", + "reference": "c8e137e594948240b03372e012344b07c61b9193", "shasum": "" }, "require": { @@ -4121,7 +3590,7 @@ ], "support": { "issues": "https://github.com/thephpleague/flysystem/issues", - "source": "https://github.com/thephpleague/flysystem/tree/3.0.17" + "source": "https://github.com/thephpleague/flysystem/tree/3.0.18" }, "funding": [ { @@ -4137,7 +3606,7 @@ "type": "tidelift" } ], - "time": "2022-04-14T14:57:13+00:00" + "time": "2022-04-25T18:55:04+00:00" }, { "name": "league/flysystem-aws-s3-v3", @@ -4356,82 +3825,6 @@ ], "time": "2022-04-17T13:12:02+00:00" }, - { - "name": "league/oauth1-client", - "version": "v1.10.1", - "source": { - "type": "git", - "url": "https://github.com/thephpleague/oauth1-client.git", - "reference": "d6365b901b5c287dd41f143033315e2f777e1167" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/thephpleague/oauth1-client/zipball/d6365b901b5c287dd41f143033315e2f777e1167", - "reference": "d6365b901b5c287dd41f143033315e2f777e1167", - "shasum": "" - }, - "require": { - "ext-json": "*", - "ext-openssl": "*", - "guzzlehttp/guzzle": "^6.0|^7.0", - "guzzlehttp/psr7": "^1.7|^2.0", - "php": ">=7.1||>=8.0" - }, - "require-dev": { - "ext-simplexml": "*", - "friendsofphp/php-cs-fixer": "^2.17", - "mockery/mockery": "^1.3.3", - "phpstan/phpstan": "^0.12.42", - "phpunit/phpunit": "^7.5||9.5" - }, - "suggest": { - "ext-simplexml": "For decoding XML-based responses." - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev", - "dev-develop": "2.0-dev" - } - }, - "autoload": { - "psr-4": { - "League\\OAuth1\\Client\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Ben Corlett", - "email": "bencorlett@me.com", - "homepage": "http://www.webcomm.com.au", - "role": "Developer" - } - ], - "description": "OAuth 1.0 Client Library", - "keywords": [ - "Authentication", - "SSO", - "authorization", - "bitbucket", - "identity", - "idp", - "oauth", - "oauth1", - "single sign on", - "trello", - "tumblr", - "twitter" - ], - "support": { - "issues": "https://github.com/thephpleague/oauth1-client/issues", - "source": "https://github.com/thephpleague/oauth1-client/tree/v1.10.1" - }, - "time": "2022-04-15T14:02:14+00:00" - }, { "name": "maennchen/zipstream-php", "version": "2.1.0", @@ -4503,114 +3896,6 @@ ], "time": "2020-05-30T13:11:16+00:00" }, - { - "name": "makingcg/subscription", - "version": "1.0.5", - "source": { - "type": "git", - "url": "git@github.com:VueFileManager/subscription.git", - "reference": "9e9e137c7e0a99cc40a46a8da64d479041a0105e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/VueFileManager/subscription/zipball/9e9e137c7e0a99cc40a46a8da64d479041a0105e", - "reference": "9e9e137c7e0a99cc40a46a8da64d479041a0105e", - "shasum": "" - }, - "require": { - "friendsofphp/php-cs-fixer": "^3.6.0", - "guzzlehttp/guzzle": "^7.4.1", - "kyslik/column-sortable": "^6.4.2", - "laravel/sanctum": "^2.14.2", - "php": "^8.0.2", - "spatie/data-transfer-object": "^3.7.3", - "spatie/laravel-package-tools": "^1.11.2", - "spatie/laravel-queueable-action": "^2.14.1", - "stripe/stripe-php": "^7.114" - }, - "require-dev": { - "brianium/paratest": "^6.4.3", - "ext-intl": "*", - "nunomaduro/collision": "^6.1", - "nunomaduro/larastan": "^1.0.3", - "orchestra/testbench": "^7.1.0", - "phpunit/phpunit": "^9.5.16", - "spatie/laravel-ray": "^1.29.4" - }, - "type": "library", - "extra": { - "laravel": { - "providers": [ - "VueFileManager\\Subscription\\SubscriptionServiceProvider" - ], - "aliases": { - "Subscription": "VueFileManager\\Subscription\\SubscriptionFacade" - } - } - }, - "autoload": { - "psr-4": { - "VueFileManager\\Subscription\\": "src", - "VueFileManager\\Subscription\\Database\\Factories\\": "database/factories" - }, - "files": [ - "src/Support/helpers.php", - "src/Support/PayPalHelpers.php", - "src/Support/PaystackHelpers.php", - "src/Support/StripeHelpers.php" - ] - }, - "autoload-dev": { - "psr-4": { - "App\\": "src/App/", - "Domain\\": "src/Domain/", - "Support\\": "src/Support/", - "Tests\\": "tests" - } - }, - "scripts": { - "psalm": [ - "vendor/bin/psalm" - ], - "format": [ - "vendor/bin/php-cs-fixer fix --allow-risky=yes" - ], - "test": [ - "./vendor/bin/testbench package:test --parallel --no-coverage" - ], - "test-coverage": [ - "vendor/bin/phpunit --coverage-html coverage" - ] - }, - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Peter Papp", - "email": "peterpapp@makingcg.com", - "role": "Developer" - } - ], - "description": "Subscription module for all great payment gateway", - "homepage": "https://github.com/makingcg/subscription", - "keywords": [ - "VueFileManager", - "laravel", - "subscription" - ], - "support": { - "source": "https://github.com/VueFileManager/subscription/tree/1.0.5", - "issues": "https://github.com/VueFileManager/subscription/issues" - }, - "funding": [ - { - "type": "github", - "url": "https://github.com/VueFileManager" - } - ], - "time": "2022-04-19T16:04:20+00:00" - }, { "name": "matthewbdaly/laravel-azure-storage", "version": "2.0.0", @@ -5517,142 +4802,6 @@ }, "time": "2022-01-17T05:32:27+00:00" }, - { - "name": "paragonie/random_compat", - "version": "v9.99.100", - "source": { - "type": "git", - "url": "https://github.com/paragonie/random_compat.git", - "reference": "996434e5492cb4c3edcb9168db6fbb1359ef965a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/paragonie/random_compat/zipball/996434e5492cb4c3edcb9168db6fbb1359ef965a", - "reference": "996434e5492cb4c3edcb9168db6fbb1359ef965a", - "shasum": "" - }, - "require": { - "php": ">= 7" - }, - "require-dev": { - "phpunit/phpunit": "4.*|5.*", - "vimeo/psalm": "^1" - }, - "suggest": { - "ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes." - }, - "type": "library", - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Paragon Initiative Enterprises", - "email": "security@paragonie.com", - "homepage": "https://paragonie.com" - } - ], - "description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7", - "keywords": [ - "csprng", - "polyfill", - "pseudorandom", - "random" - ], - "support": { - "email": "info@paragonie.com", - "issues": "https://github.com/paragonie/random_compat/issues", - "source": "https://github.com/paragonie/random_compat" - }, - "time": "2020-10-15T08:29:30+00:00" - }, - { - "name": "paragonie/sodium_compat", - "version": "v1.17.1", - "source": { - "type": "git", - "url": "https://github.com/paragonie/sodium_compat.git", - "reference": "ac994053faac18d386328c91c7900f930acadf1e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/paragonie/sodium_compat/zipball/ac994053faac18d386328c91c7900f930acadf1e", - "reference": "ac994053faac18d386328c91c7900f930acadf1e", - "shasum": "" - }, - "require": { - "paragonie/random_compat": ">=1", - "php": "^5.2.4|^5.3|^5.4|^5.5|^5.6|^7|^8" - }, - "require-dev": { - "phpunit/phpunit": "^3|^4|^5|^6|^7|^8|^9" - }, - "suggest": { - "ext-libsodium": "PHP < 7.0: Better performance, password hashing (Argon2i), secure memory management (memzero), and better security.", - "ext-sodium": "PHP >= 7.0: Better performance, password hashing (Argon2i), secure memory management (memzero), and better security." - }, - "type": "library", - "autoload": { - "files": [ - "autoload.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "ISC" - ], - "authors": [ - { - "name": "Paragon Initiative Enterprises", - "email": "security@paragonie.com" - }, - { - "name": "Frank Denis", - "email": "jedisct1@pureftpd.org" - } - ], - "description": "Pure PHP implementation of libsodium; uses the PHP extension if it exists", - "keywords": [ - "Authentication", - "BLAKE2b", - "ChaCha20", - "ChaCha20-Poly1305", - "Chapoly", - "Curve25519", - "Ed25519", - "EdDSA", - "Edwards-curve Digital Signature Algorithm", - "Elliptic Curve Diffie-Hellman", - "Poly1305", - "Pure-PHP cryptography", - "RFC 7748", - "RFC 8032", - "Salpoly", - "Salsa20", - "X25519", - "XChaCha20-Poly1305", - "XSalsa20-Poly1305", - "Xchacha20", - "Xsalsa20", - "aead", - "cryptography", - "ecdh", - "elliptic curve", - "elliptic curve cryptography", - "encryption", - "libsodium", - "php", - "public-key cryptography", - "secret-key cryptography", - "side-channel resistant" - ], - "support": { - "issues": "https://github.com/paragonie/sodium_compat/issues", - "source": "https://github.com/paragonie/sodium_compat/tree/v1.17.1" - }, - "time": "2022-03-23T19:32:04+00:00" - }, { "name": "phar-io/manifest", "version": "2.0.3", @@ -5764,58 +4913,6 @@ }, "time": "2022-02-21T01:04:05+00:00" }, - { - "name": "php-cs-fixer/diff", - "version": "v2.0.2", - "source": { - "type": "git", - "url": "https://github.com/PHP-CS-Fixer/diff.git", - "reference": "29dc0d507e838c4580d018bd8b5cb412474f7ec3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/diff/zipball/29dc0d507e838c4580d018bd8b5cb412474f7ec3", - "reference": "29dc0d507e838c4580d018bd8b5cb412474f7ec3", - "shasum": "" - }, - "require": { - "php": "^5.6 || ^7.0 || ^8.0" - }, - "require-dev": { - "phpunit/phpunit": "^5.7.23 || ^6.4.3 || ^7.0", - "symfony/process": "^3.3" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" - } - ], - "description": "sebastian/diff v3 backport support for PHP 5.6+", - "homepage": "https://github.com/PHP-CS-Fixer", - "keywords": [ - "diff" - ], - "support": { - "issues": "https://github.com/PHP-CS-Fixer/diff/issues", - "source": "https://github.com/PHP-CS-Fixer/diff/tree/v2.0.2" - }, - "time": "2020-10-14T08:32:19+00:00" - }, { "name": "phpdocumentor/reflection-common", "version": "2.2.0", @@ -6587,55 +5684,6 @@ }, "time": "2020-04-05T10:47:18+00:00" }, - { - "name": "psr/cache", - "version": "3.0.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/cache.git", - "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/cache/zipball/aa5030cfa5405eccfdcb1083ce040c2cb8d253bf", - "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf", - "shasum": "" - }, - "require": { - "php": ">=8.0.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Cache\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "Common interface for caching libraries", - "keywords": [ - "cache", - "psr", - "psr-6" - ], - "support": { - "source": "https://github.com/php-fig/cache/tree/3.0.0" - }, - "time": "2021-02-03T23:26:27+00:00" - }, { "name": "psr/container", "version": "2.0.2", @@ -7078,67 +6126,6 @@ }, "time": "2022-02-28T15:28:54+00:00" }, - { - "name": "pusher/pusher-php-server", - "version": "7.0.2", - "source": { - "type": "git", - "url": "https://github.com/pusher/pusher-http-php.git", - "reference": "af3eeaefc0c7959f5b3852f0a4dd5547245d33df" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/pusher/pusher-http-php/zipball/af3eeaefc0c7959f5b3852f0a4dd5547245d33df", - "reference": "af3eeaefc0c7959f5b3852f0a4dd5547245d33df", - "shasum": "" - }, - "require": { - "ext-curl": "*", - "ext-json": "*", - "guzzlehttp/guzzle": "^7.2", - "paragonie/sodium_compat": "^1.6", - "php": "^7.3|^8.0", - "psr/log": "^1.0|^2.0|^3.0" - }, - "require-dev": { - "overtrue/phplint": "^2.3", - "phpunit/phpunit": "^8.5|^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.0-dev" - } - }, - "autoload": { - "psr-4": { - "Pusher\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Library for interacting with the Pusher REST API", - "keywords": [ - "events", - "messaging", - "php-pusher-server", - "publish", - "push", - "pusher", - "real time", - "real-time", - "realtime", - "rest", - "trigger" - ], - "support": { - "issues": "https://github.com/pusher/pusher-http-php/issues", - "source": "https://github.com/pusher/pusher-http-php/tree/7.0.2" - }, - "time": "2021-12-07T13:09:00+00:00" - }, { "name": "ralouphie/getallheaders", "version": "3.0.3", @@ -7356,864 +6343,6 @@ ], "time": "2022-03-27T21:42:02+00:00" }, - { - "name": "ratchet/rfc6455", - "version": "v0.3.1", - "source": { - "type": "git", - "url": "https://github.com/ratchetphp/RFC6455.git", - "reference": "7c964514e93456a52a99a20fcfa0de242a43ccdb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/ratchetphp/RFC6455/zipball/7c964514e93456a52a99a20fcfa0de242a43ccdb", - "reference": "7c964514e93456a52a99a20fcfa0de242a43ccdb", - "shasum": "" - }, - "require": { - "guzzlehttp/psr7": "^2 || ^1.7", - "php": ">=5.4.2" - }, - "require-dev": { - "phpunit/phpunit": "^5.7", - "react/socket": "^1.3" - }, - "type": "library", - "autoload": { - "psr-4": { - "Ratchet\\RFC6455\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Chris Boden", - "email": "cboden@gmail.com", - "role": "Developer" - }, - { - "name": "Matt Bonneau", - "role": "Developer" - } - ], - "description": "RFC6455 WebSocket protocol handler", - "homepage": "http://socketo.me", - "keywords": [ - "WebSockets", - "rfc6455", - "websocket" - ], - "support": { - "chat": "https://gitter.im/reactphp/reactphp", - "issues": "https://github.com/ratchetphp/RFC6455/issues", - "source": "https://github.com/ratchetphp/RFC6455/tree/v0.3.1" - }, - "time": "2021-12-09T23:20:49+00:00" - }, - { - "name": "react/cache", - "version": "v1.1.1", - "source": { - "type": "git", - "url": "https://github.com/reactphp/cache.git", - "reference": "4bf736a2cccec7298bdf745db77585966fc2ca7e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/reactphp/cache/zipball/4bf736a2cccec7298bdf745db77585966fc2ca7e", - "reference": "4bf736a2cccec7298bdf745db77585966fc2ca7e", - "shasum": "" - }, - "require": { - "php": ">=5.3.0", - "react/promise": "^3.0 || ^2.0 || ^1.1" - }, - "require-dev": { - "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.35" - }, - "type": "library", - "autoload": { - "psr-4": { - "React\\Cache\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Christian Lück", - "email": "christian@clue.engineering", - "homepage": "https://clue.engineering/" - }, - { - "name": "Cees-Jan Kiewiet", - "email": "reactphp@ceesjankiewiet.nl", - "homepage": "https://wyrihaximus.net/" - }, - { - "name": "Jan Sorgalla", - "email": "jsorgalla@gmail.com", - "homepage": "https://sorgalla.com/" - }, - { - "name": "Chris Boden", - "email": "cboden@gmail.com", - "homepage": "https://cboden.dev/" - } - ], - "description": "Async, Promise-based cache interface for ReactPHP", - "keywords": [ - "cache", - "caching", - "promise", - "reactphp" - ], - "support": { - "issues": "https://github.com/reactphp/cache/issues", - "source": "https://github.com/reactphp/cache/tree/v1.1.1" - }, - "funding": [ - { - "url": "https://github.com/WyriHaximus", - "type": "github" - }, - { - "url": "https://github.com/clue", - "type": "github" - } - ], - "time": "2021-02-02T06:47:52+00:00" - }, - { - "name": "react/dns", - "version": "v1.9.0", - "source": { - "type": "git", - "url": "https://github.com/reactphp/dns.git", - "reference": "6d38296756fa644e6cb1bfe95eff0f9a4ed6edcb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/reactphp/dns/zipball/6d38296756fa644e6cb1bfe95eff0f9a4ed6edcb", - "reference": "6d38296756fa644e6cb1bfe95eff0f9a4ed6edcb", - "shasum": "" - }, - "require": { - "php": ">=5.3.0", - "react/cache": "^1.0 || ^0.6 || ^0.5", - "react/event-loop": "^1.2", - "react/promise": "^3.0 || ^2.7 || ^1.2.1", - "react/promise-timer": "^1.8" - }, - "require-dev": { - "clue/block-react": "^1.2", - "phpunit/phpunit": "^9.3 || ^4.8.35" - }, - "type": "library", - "autoload": { - "psr-4": { - "React\\Dns\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Christian Lück", - "email": "christian@clue.engineering", - "homepage": "https://clue.engineering/" - }, - { - "name": "Cees-Jan Kiewiet", - "email": "reactphp@ceesjankiewiet.nl", - "homepage": "https://wyrihaximus.net/" - }, - { - "name": "Jan Sorgalla", - "email": "jsorgalla@gmail.com", - "homepage": "https://sorgalla.com/" - }, - { - "name": "Chris Boden", - "email": "cboden@gmail.com", - "homepage": "https://cboden.dev/" - } - ], - "description": "Async DNS resolver for ReactPHP", - "keywords": [ - "async", - "dns", - "dns-resolver", - "reactphp" - ], - "support": { - "issues": "https://github.com/reactphp/dns/issues", - "source": "https://github.com/reactphp/dns/tree/v1.9.0" - }, - "funding": [ - { - "url": "https://github.com/WyriHaximus", - "type": "github" - }, - { - "url": "https://github.com/clue", - "type": "github" - } - ], - "time": "2021-12-20T08:46:54+00:00" - }, - { - "name": "react/event-loop", - "version": "v1.3.0", - "source": { - "type": "git", - "url": "https://github.com/reactphp/event-loop.git", - "reference": "187fb56f46d424afb6ec4ad089269c72eec2e137" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/reactphp/event-loop/zipball/187fb56f46d424afb6ec4ad089269c72eec2e137", - "reference": "187fb56f46d424afb6ec4ad089269c72eec2e137", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "require-dev": { - "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.35" - }, - "suggest": { - "ext-event": "~1.0 for ExtEventLoop", - "ext-pcntl": "For signal handling support when using the StreamSelectLoop", - "ext-uv": "* for ExtUvLoop" - }, - "type": "library", - "autoload": { - "psr-4": { - "React\\EventLoop\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Christian Lück", - "email": "christian@clue.engineering", - "homepage": "https://clue.engineering/" - }, - { - "name": "Cees-Jan Kiewiet", - "email": "reactphp@ceesjankiewiet.nl", - "homepage": "https://wyrihaximus.net/" - }, - { - "name": "Jan Sorgalla", - "email": "jsorgalla@gmail.com", - "homepage": "https://sorgalla.com/" - }, - { - "name": "Chris Boden", - "email": "cboden@gmail.com", - "homepage": "https://cboden.dev/" - } - ], - "description": "ReactPHP's core reactor event loop that libraries can use for evented I/O.", - "keywords": [ - "asynchronous", - "event-loop" - ], - "support": { - "issues": "https://github.com/reactphp/event-loop/issues", - "source": "https://github.com/reactphp/event-loop/tree/v1.3.0" - }, - "funding": [ - { - "url": "https://github.com/WyriHaximus", - "type": "github" - }, - { - "url": "https://github.com/clue", - "type": "github" - } - ], - "time": "2022-03-17T11:10:22+00:00" - }, - { - "name": "react/http", - "version": "v1.6.0", - "source": { - "type": "git", - "url": "https://github.com/reactphp/http.git", - "reference": "59961cc4a5b14481728f07c591546be18fa3a5c7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/reactphp/http/zipball/59961cc4a5b14481728f07c591546be18fa3a5c7", - "reference": "59961cc4a5b14481728f07c591546be18fa3a5c7", - "shasum": "" - }, - "require": { - "evenement/evenement": "^3.0 || ^2.0 || ^1.0", - "fig/http-message-util": "^1.1", - "php": ">=5.3.0", - "psr/http-message": "^1.0", - "react/event-loop": "^1.2", - "react/promise": "^2.3 || ^1.2.1", - "react/promise-stream": "^1.1", - "react/socket": "^1.9", - "react/stream": "^1.2", - "ringcentral/psr7": "^1.2" - }, - "require-dev": { - "clue/block-react": "^1.5", - "clue/http-proxy-react": "^1.7", - "clue/reactphp-ssh-proxy": "^1.3", - "clue/socks-react": "^1.3", - "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.35" - }, - "type": "library", - "autoload": { - "psr-4": { - "React\\Http\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Christian Lück", - "email": "christian@clue.engineering", - "homepage": "https://clue.engineering/" - }, - { - "name": "Cees-Jan Kiewiet", - "email": "reactphp@ceesjankiewiet.nl", - "homepage": "https://wyrihaximus.net/" - }, - { - "name": "Jan Sorgalla", - "email": "jsorgalla@gmail.com", - "homepage": "https://sorgalla.com/" - }, - { - "name": "Chris Boden", - "email": "cboden@gmail.com", - "homepage": "https://cboden.dev/" - } - ], - "description": "Event-driven, streaming HTTP client and server implementation for ReactPHP", - "keywords": [ - "async", - "client", - "event-driven", - "http", - "http client", - "http server", - "https", - "psr-7", - "reactphp", - "server", - "streaming" - ], - "support": { - "issues": "https://github.com/reactphp/http/issues", - "source": "https://github.com/reactphp/http/tree/v1.6.0" - }, - "funding": [ - { - "url": "https://github.com/WyriHaximus", - "type": "github" - }, - { - "url": "https://github.com/clue", - "type": "github" - } - ], - "time": "2022-02-03T13:17:37+00:00" - }, - { - "name": "react/promise", - "version": "v2.9.0", - "source": { - "type": "git", - "url": "https://github.com/reactphp/promise.git", - "reference": "234f8fd1023c9158e2314fa9d7d0e6a83db42910" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/reactphp/promise/zipball/234f8fd1023c9158e2314fa9d7d0e6a83db42910", - "reference": "234f8fd1023c9158e2314fa9d7d0e6a83db42910", - "shasum": "" - }, - "require": { - "php": ">=5.4.0" - }, - "require-dev": { - "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.36" - }, - "type": "library", - "autoload": { - "files": [ - "src/functions_include.php" - ], - "psr-4": { - "React\\Promise\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jan Sorgalla", - "email": "jsorgalla@gmail.com", - "homepage": "https://sorgalla.com/" - }, - { - "name": "Christian Lück", - "email": "christian@clue.engineering", - "homepage": "https://clue.engineering/" - }, - { - "name": "Cees-Jan Kiewiet", - "email": "reactphp@ceesjankiewiet.nl", - "homepage": "https://wyrihaximus.net/" - }, - { - "name": "Chris Boden", - "email": "cboden@gmail.com", - "homepage": "https://cboden.dev/" - } - ], - "description": "A lightweight implementation of CommonJS Promises/A for PHP", - "keywords": [ - "promise", - "promises" - ], - "support": { - "issues": "https://github.com/reactphp/promise/issues", - "source": "https://github.com/reactphp/promise/tree/v2.9.0" - }, - "funding": [ - { - "url": "https://github.com/WyriHaximus", - "type": "github" - }, - { - "url": "https://github.com/clue", - "type": "github" - } - ], - "time": "2022-02-11T10:27:51+00:00" - }, - { - "name": "react/promise-stream", - "version": "v1.3.0", - "source": { - "type": "git", - "url": "https://github.com/reactphp/promise-stream.git", - "reference": "3ebd94fe0d8edbf44937948af28d02d5437e9949" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/reactphp/promise-stream/zipball/3ebd94fe0d8edbf44937948af28d02d5437e9949", - "reference": "3ebd94fe0d8edbf44937948af28d02d5437e9949", - "shasum": "" - }, - "require": { - "php": ">=5.3", - "react/promise": "^2.1 || ^1.2", - "react/stream": "^1.0 || ^0.7 || ^0.6 || ^0.5 || ^0.4.6" - }, - "require-dev": { - "clue/block-react": "^1.0", - "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.35", - "react/event-loop": "^1.0 || ^0.5 || ^0.4 || ^0.3", - "react/promise-timer": "^1.0" - }, - "type": "library", - "autoload": { - "files": [ - "src/functions_include.php" - ], - "psr-4": { - "React\\Promise\\Stream\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Christian Lück", - "email": "christian@clue.engineering", - "homepage": "https://clue.engineering/" - }, - { - "name": "Cees-Jan Kiewiet", - "email": "reactphp@ceesjankiewiet.nl", - "homepage": "https://wyrihaximus.net/" - }, - { - "name": "Jan Sorgalla", - "email": "jsorgalla@gmail.com", - "homepage": "https://sorgalla.com/" - }, - { - "name": "Chris Boden", - "email": "cboden@gmail.com", - "homepage": "https://cboden.dev/" - } - ], - "description": "The missing link between Promise-land and Stream-land for ReactPHP", - "homepage": "https://github.com/reactphp/promise-stream", - "keywords": [ - "Buffer", - "async", - "promise", - "reactphp", - "stream", - "unwrap" - ], - "support": { - "issues": "https://github.com/reactphp/promise-stream/issues", - "source": "https://github.com/reactphp/promise-stream/tree/v1.3.0" - }, - "funding": [ - { - "url": "https://github.com/WyriHaximus", - "type": "github" - }, - { - "url": "https://github.com/clue", - "type": "github" - } - ], - "time": "2021-10-18T10:47:09+00:00" - }, - { - "name": "react/promise-timer", - "version": "v1.8.0", - "source": { - "type": "git", - "url": "https://github.com/reactphp/promise-timer.git", - "reference": "0bbbcc79589e5bfdddba68a287f1cb805581a479" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/reactphp/promise-timer/zipball/0bbbcc79589e5bfdddba68a287f1cb805581a479", - "reference": "0bbbcc79589e5bfdddba68a287f1cb805581a479", - "shasum": "" - }, - "require": { - "php": ">=5.3", - "react/event-loop": "^1.2", - "react/promise": "^3.0 || ^2.7.0 || ^1.2.1" - }, - "require-dev": { - "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.35" - }, - "type": "library", - "autoload": { - "files": [ - "src/functions_include.php" - ], - "psr-4": { - "React\\Promise\\Timer\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Christian Lück", - "email": "christian@clue.engineering", - "homepage": "https://clue.engineering/" - }, - { - "name": "Cees-Jan Kiewiet", - "email": "reactphp@ceesjankiewiet.nl", - "homepage": "https://wyrihaximus.net/" - }, - { - "name": "Jan Sorgalla", - "email": "jsorgalla@gmail.com", - "homepage": "https://sorgalla.com/" - }, - { - "name": "Chris Boden", - "email": "cboden@gmail.com", - "homepage": "https://cboden.dev/" - } - ], - "description": "A trivial implementation of timeouts for Promises, built on top of ReactPHP.", - "homepage": "https://github.com/reactphp/promise-timer", - "keywords": [ - "async", - "event-loop", - "promise", - "reactphp", - "timeout", - "timer" - ], - "support": { - "issues": "https://github.com/reactphp/promise-timer/issues", - "source": "https://github.com/reactphp/promise-timer/tree/v1.8.0" - }, - "funding": [ - { - "url": "https://github.com/WyriHaximus", - "type": "github" - }, - { - "url": "https://github.com/clue", - "type": "github" - } - ], - "time": "2021-12-06T11:08:48+00:00" - }, - { - "name": "react/socket", - "version": "v1.11.0", - "source": { - "type": "git", - "url": "https://github.com/reactphp/socket.git", - "reference": "f474156aaab4f09041144fa8b57c7d70aed32a1c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/reactphp/socket/zipball/f474156aaab4f09041144fa8b57c7d70aed32a1c", - "reference": "f474156aaab4f09041144fa8b57c7d70aed32a1c", - "shasum": "" - }, - "require": { - "evenement/evenement": "^3.0 || ^2.0 || ^1.0", - "php": ">=5.3.0", - "react/dns": "^1.8", - "react/event-loop": "^1.2", - "react/promise": "^2.6.0 || ^1.2.1", - "react/promise-timer": "^1.8", - "react/stream": "^1.2" - }, - "require-dev": { - "clue/block-react": "^1.5", - "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.35", - "react/promise-stream": "^1.2" - }, - "type": "library", - "autoload": { - "psr-4": { - "React\\Socket\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Christian Lück", - "email": "christian@clue.engineering", - "homepage": "https://clue.engineering/" - }, - { - "name": "Cees-Jan Kiewiet", - "email": "reactphp@ceesjankiewiet.nl", - "homepage": "https://wyrihaximus.net/" - }, - { - "name": "Jan Sorgalla", - "email": "jsorgalla@gmail.com", - "homepage": "https://sorgalla.com/" - }, - { - "name": "Chris Boden", - "email": "cboden@gmail.com", - "homepage": "https://cboden.dev/" - } - ], - "description": "Async, streaming plaintext TCP/IP and secure TLS socket server and client connections for ReactPHP", - "keywords": [ - "Connection", - "Socket", - "async", - "reactphp", - "stream" - ], - "support": { - "issues": "https://github.com/reactphp/socket/issues", - "source": "https://github.com/reactphp/socket/tree/v1.11.0" - }, - "funding": [ - { - "url": "https://github.com/WyriHaximus", - "type": "github" - }, - { - "url": "https://github.com/clue", - "type": "github" - } - ], - "time": "2022-01-14T10:14:32+00:00" - }, - { - "name": "react/stream", - "version": "v1.2.0", - "source": { - "type": "git", - "url": "https://github.com/reactphp/stream.git", - "reference": "7a423506ee1903e89f1e08ec5f0ed430ff784ae9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/reactphp/stream/zipball/7a423506ee1903e89f1e08ec5f0ed430ff784ae9", - "reference": "7a423506ee1903e89f1e08ec5f0ed430ff784ae9", - "shasum": "" - }, - "require": { - "evenement/evenement": "^3.0 || ^2.0 || ^1.0", - "php": ">=5.3.8", - "react/event-loop": "^1.2" - }, - "require-dev": { - "clue/stream-filter": "~1.2", - "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.35" - }, - "type": "library", - "autoload": { - "psr-4": { - "React\\Stream\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Christian Lück", - "email": "christian@clue.engineering", - "homepage": "https://clue.engineering/" - }, - { - "name": "Cees-Jan Kiewiet", - "email": "reactphp@ceesjankiewiet.nl", - "homepage": "https://wyrihaximus.net/" - }, - { - "name": "Jan Sorgalla", - "email": "jsorgalla@gmail.com", - "homepage": "https://sorgalla.com/" - }, - { - "name": "Chris Boden", - "email": "cboden@gmail.com", - "homepage": "https://cboden.dev/" - } - ], - "description": "Event-driven readable and writable streams for non-blocking I/O in ReactPHP", - "keywords": [ - "event-driven", - "io", - "non-blocking", - "pipe", - "reactphp", - "readable", - "stream", - "writable" - ], - "support": { - "issues": "https://github.com/reactphp/stream/issues", - "source": "https://github.com/reactphp/stream/tree/v1.2.0" - }, - "funding": [ - { - "url": "https://github.com/WyriHaximus", - "type": "github" - }, - { - "url": "https://github.com/clue", - "type": "github" - } - ], - "time": "2021-07-11T12:37:55+00:00" - }, - { - "name": "ringcentral/psr7", - "version": "1.3.0", - "source": { - "type": "git", - "url": "https://github.com/ringcentral/psr7.git", - "reference": "360faaec4b563958b673fb52bbe94e37f14bc686" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/ringcentral/psr7/zipball/360faaec4b563958b673fb52bbe94e37f14bc686", - "reference": "360faaec4b563958b673fb52bbe94e37f14bc686", - "shasum": "" - }, - "require": { - "php": ">=5.3", - "psr/http-message": "~1.0" - }, - "provide": { - "psr/http-message-implementation": "1.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "files": [ - "src/functions_include.php" - ], - "psr-4": { - "RingCentral\\Psr7\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - } - ], - "description": "PSR-7 message implementation", - "keywords": [ - "http", - "message", - "stream", - "uri" - ], - "support": { - "source": "https://github.com/ringcentral/psr7/tree/master" - }, - "time": "2018-05-29T20:21:04+00:00" - }, { "name": "sebastian/cli-parser", "version": "1.0.1", @@ -9461,16 +7590,16 @@ }, { "name": "spatie/laravel-query-builder", - "version": "5.0.1", + "version": "5.0.2", "source": { "type": "git", "url": "https://github.com/spatie/laravel-query-builder.git", - "reference": "2970e54b04306a6de586d23ac3e0bab994ef645a" + "reference": "fceb1e1814b117494a277b765050a3a10bfc162f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/laravel-query-builder/zipball/2970e54b04306a6de586d23ac3e0bab994ef645a", - "reference": "2970e54b04306a6de586d23ac3e0bab994ef645a", + "url": "https://api.github.com/repos/spatie/laravel-query-builder/zipball/fceb1e1814b117494a277b765050a3a10bfc162f", + "reference": "fceb1e1814b117494a277b765050a3a10bfc162f", "shasum": "" }, "require": { @@ -9529,7 +7658,7 @@ "type": "custom" } ], - "time": "2022-03-18T07:44:25+00:00" + "time": "2022-04-25T07:07:24+00:00" }, { "name": "spatie/laravel-queueable-action", @@ -9942,66 +8071,6 @@ }, "time": "2022-04-04T13:05:01+00:00" }, - { - "name": "stripe/stripe-php", - "version": "v7.124.0", - "source": { - "type": "git", - "url": "https://github.com/stripe/stripe-php.git", - "reference": "548e8ef08a86c6c621446082393dc6a1af51076c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/stripe/stripe-php/zipball/548e8ef08a86c6c621446082393dc6a1af51076c", - "reference": "548e8ef08a86c6c621446082393dc6a1af51076c", - "shasum": "" - }, - "require": { - "ext-curl": "*", - "ext-json": "*", - "ext-mbstring": "*", - "php": ">=5.6.0" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "3.5.0", - "phpstan/phpstan": "^1.2", - "phpunit/phpunit": "^5.7 || ^9.0", - "squizlabs/php_codesniffer": "^3.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, - "autoload": { - "psr-4": { - "Stripe\\": "lib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Stripe and contributors", - "homepage": "https://github.com/stripe/stripe-php/contributors" - } - ], - "description": "Stripe PHP Library", - "homepage": "https://stripe.com/", - "keywords": [ - "api", - "payment processing", - "stripe" - ], - "support": { - "issues": "https://github.com/stripe/stripe-php/issues", - "source": "https://github.com/stripe/stripe-php/tree/v7.124.0" - }, - "time": "2022-04-18T23:07:08+00:00" - }, { "name": "symfony/console", "version": "v6.0.7", @@ -10462,69 +8531,6 @@ ], "time": "2022-01-02T09:55:41+00:00" }, - { - "name": "symfony/filesystem", - "version": "v6.0.7", - "source": { - "type": "git", - "url": "https://github.com/symfony/filesystem.git", - "reference": "6c9e4c41f2c51dfde3db298594ed9cba55dbf5ff" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/6c9e4c41f2c51dfde3db298594ed9cba55dbf5ff", - "reference": "6c9e4c41f2c51dfde3db298594ed9cba55dbf5ff", - "shasum": "" - }, - "require": { - "php": ">=8.0.2", - "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-mbstring": "~1.8" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Filesystem\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Provides basic utilities for the filesystem", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/filesystem/tree/v6.0.7" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2022-04-01T12:54:51+00:00" - }, { "name": "symfony/finder", "version": "v6.0.3", @@ -11149,73 +9155,6 @@ ], "time": "2022-03-13T20:10:05+00:00" }, - { - "name": "symfony/options-resolver", - "version": "v6.0.3", - "source": { - "type": "git", - "url": "https://github.com/symfony/options-resolver.git", - "reference": "51f7006670febe4cbcbae177cbffe93ff833250d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/51f7006670febe4cbcbae177cbffe93ff833250d", - "reference": "51f7006670febe4cbcbae177cbffe93ff833250d", - "shasum": "" - }, - "require": { - "php": ">=8.0.2", - "symfony/deprecation-contracts": "^2.1|^3" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\OptionsResolver\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Provides an improved replacement for the array_replace PHP function", - "homepage": "https://symfony.com", - "keywords": [ - "config", - "configuration", - "options" - ], - "support": { - "source": "https://github.com/symfony/options-resolver/tree/v6.0.3" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2022-01-02T09:55:41+00:00" - }, { "name": "symfony/polyfill-ctype", "version": "v1.25.0", @@ -11997,94 +9936,6 @@ ], "time": "2022-03-18T16:21:55+00:00" }, - { - "name": "symfony/psr-http-message-bridge", - "version": "v2.1.2", - "source": { - "type": "git", - "url": "https://github.com/symfony/psr-http-message-bridge.git", - "reference": "22b37c8a3f6b5d94e9cdbd88e1270d96e2f97b34" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/psr-http-message-bridge/zipball/22b37c8a3f6b5d94e9cdbd88e1270d96e2f97b34", - "reference": "22b37c8a3f6b5d94e9cdbd88e1270d96e2f97b34", - "shasum": "" - }, - "require": { - "php": ">=7.1", - "psr/http-message": "^1.0", - "symfony/http-foundation": "^4.4 || ^5.0 || ^6.0" - }, - "require-dev": { - "nyholm/psr7": "^1.1", - "psr/log": "^1.1 || ^2 || ^3", - "symfony/browser-kit": "^4.4 || ^5.0 || ^6.0", - "symfony/config": "^4.4 || ^5.0 || ^6.0", - "symfony/event-dispatcher": "^4.4 || ^5.0 || ^6.0", - "symfony/framework-bundle": "^4.4 || ^5.0 || ^6.0", - "symfony/http-kernel": "^4.4 || ^5.0 || ^6.0", - "symfony/phpunit-bridge": "^5.4@dev || ^6.0" - }, - "suggest": { - "nyholm/psr7": "For a super lightweight PSR-7/17 implementation" - }, - "type": "symfony-bridge", - "extra": { - "branch-alias": { - "dev-main": "2.1-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Bridge\\PsrHttpMessage\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - } - ], - "description": "PSR HTTP message bridge", - "homepage": "http://symfony.com", - "keywords": [ - "http", - "http-message", - "psr-17", - "psr-7" - ], - "support": { - "issues": "https://github.com/symfony/psr-http-message-bridge/issues", - "source": "https://github.com/symfony/psr-http-message-bridge/tree/v2.1.2" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2021-11-05T13:13:39+00:00" - }, { "name": "symfony/routing", "version": "v6.0.5", @@ -12255,68 +10106,6 @@ ], "time": "2022-03-13T20:10:05+00:00" }, - { - "name": "symfony/stopwatch", - "version": "v6.0.5", - "source": { - "type": "git", - "url": "https://github.com/symfony/stopwatch.git", - "reference": "f2c1780607ec6502f2121d9729fd8150a655d337" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/f2c1780607ec6502f2121d9729fd8150a655d337", - "reference": "f2c1780607ec6502f2121d9729fd8150a655d337", - "shasum": "" - }, - "require": { - "php": ">=8.0.2", - "symfony/service-contracts": "^1|^2|^3" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Stopwatch\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Provides a way to profile code", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/stopwatch/tree/v6.0.5" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2022-02-21T17:15:17+00:00" - }, { "name": "symfony/string", "version": "v6.0.3", @@ -13761,6 +11550,131 @@ ], "time": "2021-11-18T10:14:14+00:00" }, + { + "name": "doctrine/annotations", + "version": "1.13.2", + "source": { + "type": "git", + "url": "https://github.com/doctrine/annotations.git", + "reference": "5b668aef16090008790395c02c893b1ba13f7e08" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/annotations/zipball/5b668aef16090008790395c02c893b1ba13f7e08", + "reference": "5b668aef16090008790395c02c893b1ba13f7e08", + "shasum": "" + }, + "require": { + "doctrine/lexer": "1.*", + "ext-tokenizer": "*", + "php": "^7.1 || ^8.0", + "psr/cache": "^1 || ^2 || ^3" + }, + "require-dev": { + "doctrine/cache": "^1.11 || ^2.0", + "doctrine/coding-standard": "^6.0 || ^8.1", + "phpstan/phpstan": "^0.12.20", + "phpunit/phpunit": "^7.5 || ^8.0 || ^9.1.5", + "symfony/cache": "^4.4 || ^5.2" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Common\\Annotations\\": "lib/Doctrine/Common/Annotations" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "Docblock Annotations Parser", + "homepage": "https://www.doctrine-project.org/projects/annotations.html", + "keywords": [ + "annotations", + "docblock", + "parser" + ], + "support": { + "issues": "https://github.com/doctrine/annotations/issues", + "source": "https://github.com/doctrine/annotations/tree/1.13.2" + }, + "time": "2021-08-05T19:00:23+00:00" + }, + { + "name": "facade/ignition-contracts", + "version": "1.0.2", + "source": { + "type": "git", + "url": "https://github.com/facade/ignition-contracts.git", + "reference": "3c921a1cdba35b68a7f0ccffc6dffc1995b18267" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/facade/ignition-contracts/zipball/3c921a1cdba35b68a7f0ccffc6dffc1995b18267", + "reference": "3c921a1cdba35b68a7f0ccffc6dffc1995b18267", + "shasum": "" + }, + "require": { + "php": "^7.3|^8.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^v2.15.8", + "phpunit/phpunit": "^9.3.11", + "vimeo/psalm": "^3.17.1" + }, + "type": "library", + "autoload": { + "psr-4": { + "Facade\\IgnitionContracts\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Freek Van der Herten", + "email": "freek@spatie.be", + "homepage": "https://flareapp.io", + "role": "Developer" + } + ], + "description": "Solution contracts for Ignition", + "homepage": "https://github.com/facade/ignition-contracts", + "keywords": [ + "contracts", + "flare", + "ignition" + ], + "support": { + "issues": "https://github.com/facade/ignition-contracts/issues", + "source": "https://github.com/facade/ignition-contracts/tree/1.0.2" + }, + "time": "2020-10-16T08:27:54+00:00" + }, { "name": "fakerphp/faker", "version": "v1.19.0", @@ -13899,6 +11813,95 @@ ], "time": "2022-01-07T12:00:00+00:00" }, + { + "name": "friendsofphp/php-cs-fixer", + "version": "v3.8.0", + "source": { + "type": "git", + "url": "https://github.com/FriendsOfPHP/PHP-CS-Fixer.git", + "reference": "cbad1115aac4b5c3c5540e7210d3c9fba2f81fa3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/cbad1115aac4b5c3c5540e7210d3c9fba2f81fa3", + "reference": "cbad1115aac4b5c3c5540e7210d3c9fba2f81fa3", + "shasum": "" + }, + "require": { + "composer/semver": "^3.2", + "composer/xdebug-handler": "^3.0.3", + "doctrine/annotations": "^1.13", + "ext-json": "*", + "ext-tokenizer": "*", + "php": "^7.4 || ^8.0", + "php-cs-fixer/diff": "^2.0", + "symfony/console": "^5.4 || ^6.0", + "symfony/event-dispatcher": "^5.4 || ^6.0", + "symfony/filesystem": "^5.4 || ^6.0", + "symfony/finder": "^5.4 || ^6.0", + "symfony/options-resolver": "^5.4 || ^6.0", + "symfony/polyfill-mbstring": "^1.23", + "symfony/polyfill-php80": "^1.25", + "symfony/polyfill-php81": "^1.25", + "symfony/process": "^5.4 || ^6.0", + "symfony/stopwatch": "^5.4 || ^6.0" + }, + "require-dev": { + "justinrainbow/json-schema": "^5.2", + "keradus/cli-executor": "^1.5", + "mikey179/vfsstream": "^1.6.10", + "php-coveralls/php-coveralls": "^2.5.2", + "php-cs-fixer/accessible-object": "^1.1", + "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.2", + "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.2.1", + "phpspec/prophecy": "^1.15", + "phpspec/prophecy-phpunit": "^2.0", + "phpunit/phpunit": "^9.5", + "phpunitgoodpractices/polyfill": "^1.5", + "phpunitgoodpractices/traits": "^1.9.1", + "symfony/phpunit-bridge": "^6.0", + "symfony/yaml": "^5.4 || ^6.0" + }, + "suggest": { + "ext-dom": "For handling output formats in XML", + "ext-mbstring": "For handling non-UTF8 characters." + }, + "bin": [ + "php-cs-fixer" + ], + "type": "application", + "autoload": { + "psr-4": { + "PhpCsFixer\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Dariusz Rumiński", + "email": "dariusz.ruminski@gmail.com" + } + ], + "description": "A tool to automatically fix PHP code style", + "support": { + "issues": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/issues", + "source": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/tree/v3.8.0" + }, + "funding": [ + { + "url": "https://github.com/keradus", + "type": "github" + } + ], + "time": "2022-03-18T17:20:59+00:00" + }, { "name": "hamcrest/hamcrest-php", "version": "v2.0.1", @@ -14277,6 +12280,58 @@ ], "time": "2021-10-26T11:07:56+00:00" }, + { + "name": "php-cs-fixer/diff", + "version": "v2.0.2", + "source": { + "type": "git", + "url": "https://github.com/PHP-CS-Fixer/diff.git", + "reference": "29dc0d507e838c4580d018bd8b5cb412474f7ec3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHP-CS-Fixer/diff/zipball/29dc0d507e838c4580d018bd8b5cb412474f7ec3", + "reference": "29dc0d507e838c4580d018bd8b5cb412474f7ec3", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0 || ^8.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.7.23 || ^6.4.3 || ^7.0", + "symfony/process": "^3.3" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + } + ], + "description": "sebastian/diff v3 backport support for PHP 5.6+", + "homepage": "https://github.com/PHP-CS-Fixer", + "keywords": [ + "diff" + ], + "support": { + "issues": "https://github.com/PHP-CS-Fixer/diff/issues", + "source": "https://github.com/PHP-CS-Fixer/diff/tree/v2.0.2" + }, + "time": "2020-10-14T08:32:19+00:00" + }, { "name": "phpstan/phpstan", "version": "0.12.99", @@ -14341,6 +12396,131 @@ ], "time": "2021-09-12T20:09:55+00:00" }, + { + "name": "psr/cache", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/cache.git", + "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/cache/zipball/aa5030cfa5405eccfdcb1083ce040c2cb8d253bf", + "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf", + "shasum": "" + }, + "require": { + "php": ">=8.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Cache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for caching libraries", + "keywords": [ + "cache", + "psr", + "psr-6" + ], + "support": { + "source": "https://github.com/php-fig/cache/tree/3.0.0" + }, + "time": "2021-02-03T23:26:27+00:00" + }, + { + "name": "react/promise", + "version": "v2.9.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/promise.git", + "reference": "234f8fd1023c9158e2314fa9d7d0e6a83db42910" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/promise/zipball/234f8fd1023c9158e2314fa9d7d0e6a83db42910", + "reference": "234f8fd1023c9158e2314fa9d7d0e6a83db42910", + "shasum": "" + }, + "require": { + "php": ">=5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.36" + }, + "type": "library", + "autoload": { + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "React\\Promise\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "A lightweight implementation of CommonJS Promises/A for PHP", + "keywords": [ + "promise", + "promises" + ], + "support": { + "issues": "https://github.com/reactphp/promise/issues", + "source": "https://github.com/reactphp/promise/tree/v2.9.0" + }, + "funding": [ + { + "url": "https://github.com/WyriHaximus", + "type": "github" + }, + { + "url": "https://github.com/clue", + "type": "github" + } + ], + "time": "2022-02-11T10:27:51+00:00" + }, { "name": "seld/jsonlint", "version": "1.9.0", @@ -14581,16 +12761,16 @@ }, { "name": "spatie/ignition", - "version": "1.2.7", + "version": "1.2.9", "source": { "type": "git", "url": "https://github.com/spatie/ignition.git", - "reference": "2f059cf42b48f7c522efbba1c05ad59fc2c1a3f2" + "reference": "db25202fab2d5c14613b8914a1bb374998bbf870" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/ignition/zipball/2f059cf42b48f7c522efbba1c05ad59fc2c1a3f2", - "reference": "2f059cf42b48f7c522efbba1c05ad59fc2c1a3f2", + "url": "https://api.github.com/repos/spatie/ignition/zipball/db25202fab2d5c14613b8914a1bb374998bbf870", + "reference": "db25202fab2d5c14613b8914a1bb374998bbf870", "shasum": "" }, "require": { @@ -14647,7 +12827,7 @@ "type": "github" } ], - "time": "2022-03-29T08:48:34+00:00" + "time": "2022-04-23T20:37:21+00:00" }, { "name": "spatie/laravel-ignition", @@ -14739,6 +12919,136 @@ ], "time": "2022-04-14T18:04:51+00:00" }, + { + "name": "symfony/filesystem", + "version": "v6.0.7", + "source": { + "type": "git", + "url": "https://github.com/symfony/filesystem.git", + "reference": "6c9e4c41f2c51dfde3db298594ed9cba55dbf5ff" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/6c9e4c41f2c51dfde3db298594ed9cba55dbf5ff", + "reference": "6c9e4c41f2c51dfde3db298594ed9cba55dbf5ff", + "shasum": "" + }, + "require": { + "php": ">=8.0.2", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-mbstring": "~1.8" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Filesystem\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides basic utilities for the filesystem", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/filesystem/tree/v6.0.7" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-04-01T12:54:51+00:00" + }, + { + "name": "symfony/options-resolver", + "version": "v6.0.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/options-resolver.git", + "reference": "51f7006670febe4cbcbae177cbffe93ff833250d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/51f7006670febe4cbcbae177cbffe93ff833250d", + "reference": "51f7006670febe4cbcbae177cbffe93ff833250d", + "shasum": "" + }, + "require": { + "php": ">=8.0.2", + "symfony/deprecation-contracts": "^2.1|^3" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\OptionsResolver\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides an improved replacement for the array_replace PHP function", + "homepage": "https://symfony.com", + "keywords": [ + "config", + "configuration", + "options" + ], + "support": { + "source": "https://github.com/symfony/options-resolver/tree/v6.0.3" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-01-02T09:55:41+00:00" + }, { "name": "symfony/polyfill-php73", "version": "v1.25.0", @@ -14817,6 +13127,68 @@ } ], "time": "2021-06-05T21:20:04+00:00" + }, + { + "name": "symfony/stopwatch", + "version": "v6.0.5", + "source": { + "type": "git", + "url": "https://github.com/symfony/stopwatch.git", + "reference": "f2c1780607ec6502f2121d9729fd8150a655d337" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/f2c1780607ec6502f2121d9729fd8150a655d337", + "reference": "f2c1780607ec6502f2121d9729fd8150a655d337", + "shasum": "" + }, + "require": { + "php": ">=8.0.2", + "symfony/service-contracts": "^1|^2|^3" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Stopwatch\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides a way to profile code", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/stopwatch/tree/v6.0.5" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-02-21T17:15:17+00:00" } ], "aliases": [], diff --git a/config/app.php b/config/app.php index 8f9541a4..85eef98c 100644 --- a/config/app.php +++ b/config/app.php @@ -161,7 +161,6 @@ return [ Illuminate\View\ViewServiceProvider::class, TeamTNT\Scout\TNTSearchScoutServiceProvider::class, - Laravel\Socialite\SocialiteServiceProvider::class, Intervention\Image\ImageServiceProvider::class, App\Providers\FortifyServiceProvider::class, diff --git a/routes/teams.php b/routes/teams.php deleted file mode 100644 index 8490eb63..00000000 --- a/routes/teams.php +++ /dev/null @@ -1,19 +0,0 @@ - ['auth:sanctum']], function () { - Route::get('/shared-with-me/{id}', BrowseSharedWithMeController::class); - Route::apiResource('/folders', TeamFoldersController::class); - - Route::post('/folders/{folder}/convert', ConvertFolderIntoTeamFolderController::class); - Route::delete('/folders/{folder}/leave', LeaveTeamFolderController::class); - Route::get('/folders/{folder}/tree', NavigationTreeController::class); -}); diff --git a/routes/upload-request.php b/routes/upload-request.php deleted file mode 100644 index e2892283..00000000 --- a/routes/upload-request.php +++ /dev/null @@ -1,38 +0,0 @@ - 'upload-request'], function () { - // Detail - Route::delete('/{uploadRequest}', SetUploadRequestAsFilledController::class); - - // Edit - Route::post('/{uploadRequest}/upload/remote', UploadFilesRemotelyForUploadRequestController::class); - Route::post('/{uploadRequest}/upload', UploadFilesForUploadRequestController::class); - Route::patch('/{uploadRequest}/rename/{id}', RenameFileOrFolderController::class); - Route::post('/{uploadRequest}/create-folder', CreateFolderController::class); - Route::post('/{uploadRequest}/remove', DeleteFileOrFolderController::class); - - // Browsing - Route::get('/{uploadRequest}/navigation', GetFolderTreeForUploadRequestController::class); - Route::get('/{uploadRequest}/browse/{folder?}', BrowseUploadRequestController::class); - Route::post('/{uploadRequest}/move', MoveItemInUploadRequestController::class); -}); - -// User functionality -Route::group(['middleware' => ['auth:sanctum']], function () { - Route::post('/', CreateUploadRequestController::class); -}); diff --git a/src/App/Console/Commands/GenerateDemoSubscriptionContentCommand.php b/src/App/Console/Commands/GenerateDemoSubscriptionContentCommand.php deleted file mode 100644 index 8d00f0d6..00000000 --- a/src/App/Console/Commands/GenerateDemoSubscriptionContentCommand.php +++ /dev/null @@ -1,569 +0,0 @@ -each(fn ($name) => DB::table($name)->truncate()); - - // Create plans and subscriptions for metered billing - if ($this->argument('type') === 'metered') { - $this->info('Setting up new metered plans demo data...'); - $this->generateMeteredPlans(); - - $this->info('Setting up new pre-paid subscriptions data...'); - $this->generateMeteredSubscription(); - } - - // Create plans and subscriptions for fixed billing - if ($this->argument('type') === 'fixed') { - // TODO: check for credentials - - $this->info('Setting up new fixed plans demo data...'); - $this->generateFixedPlans(); - - $this->info('Setting up new fixed subscriptions data...'); - $this->generateFixedSubscription(); - } - - // Set subscription type for the app - Setting::updateOrCreate([ - 'name' => 'subscription_type', - ], [ - 'value' => $this->argument('type'), - ]); - } - - public function generateMeteredSubscription(): void - { - $plan = Plan::where('name', 'Pay as You Go') - ->first(); - - User::all() - ->each(function ($user) use ($plan) { - $isHowdy = $user->email === 'howdy@hi5ve.digital'; - - $this->info("Storing {$plan->name} for {$user->email}..."); - - // 1. Create subscription - $subscription = Subscription::create([ - 'user_id' => $user->id, - 'type' => 'pre-paid', - 'plan_id' => $plan->id, - 'name' => $plan->name, - 'status' => 'active', - 'renews_at' => now()->addDays(16), - 'created_at' => now()->subDays(14), - 'updated_at' => now()->subDays(14), - ]); - - // 2. Log fake storage and bandwidth - foreach (range(1, 31) as $item) { - $this->info('Logging fake bandwidth usage...'); - - $bandwidthFeature = $plan - ->meteredFeatures() - ->where('key', 'bandwidth') - ->first(); - - $subscription->usages()->create([ - 'metered_feature_id' => $bandwidthFeature->id, - 'quantity' => random_int(111, 999) / 1000, - 'created_at' => now()->subDays($item), - ]); - - $this->info('Logging fake storage usage...'); - - $storageFeature = $plan - ->meteredFeatures() - ->where('key', 'storage') - ->first(); - - $subscription->usages()->create([ - 'metered_feature_id' => $storageFeature->id, - 'quantity' => random_int(1111, 3999) / 1000, - 'created_at' => now()->subDays($item), - ]); - } - - // 3. Store flat fee - $flatFeeFeature = $plan - ->meteredFeatures() - ->where('key', 'flatFee') - ->first(); - - $subscription->usages()->create([ - 'metered_feature_id' => $flatFeeFeature->id, - 'quantity' => 1, - 'created_at' => now()->subDays(2), - ]); - - // 4. Store member count - $memberFeature = $plan - ->meteredFeatures() - ->where('key', 'member') - ->first(); - - $subscription->usages()->create([ - 'metered_feature_id' => $memberFeature->id, - 'quantity' => 7, - 'created_at' => now()->subDays(2), - ]); - - // 5. Store fake transactions - $this->info("Storing transactions for {$user->email}..."); - - collect([ - [ - 'type' => 'withdrawal', - 'created_at' => now()->subDays(2), - 'amount' => $isHowdy ? 12.59 : random_int(1, 20), - 'note' => now()->subDays(32)->format('d. M') . ' - ' . now()->subDays(2)->format('d. M'), - 'driver' => 'system', - ], - [ - 'type' => 'credit', - 'created_at' => now()->subDays(26 * 1), - 'note' => __('Bonus'), - 'amount' => $isHowdy ? 12.00 : random_int(1, 20), - 'driver' => 'system', - ], - [ - 'type' => 'withdrawal', - 'created_at' => now()->subDays(26 * 1), - 'note' => now()->subDays(30 + 26 * 1)->format('d. M') . ' - ' . now()->subDays(26 * 1)->format('d. M'), - 'amount' => $isHowdy ? 2.38 : random_int(1, 20), - 'driver' => 'system', - ], - [ - 'type' => 'withdrawal', - 'created_at' => now()->subDays(26 * 2), - 'note' => now()->subDays(30 + 26 * 2)->format('d. M') . ' - ' . now()->subDays(26 * 2)->format('d. M'), - 'amount' => $isHowdy ? 5.12 : random_int(1, 20), - 'driver' => 'system', - ], - [ - 'type' => 'withdrawal', - 'created_at' => now()->subDays(26 * 3), - 'note' => now()->subDays(30 + 26 * 3)->format('d. M') . ' - ' . now()->subDays(26 * 3)->format('d. M'), - 'amount' => $isHowdy ? 3.89 : random_int(1, 20), - 'driver' => 'system', - ], - [ - 'type' => 'withdrawal', - 'created_at' => now()->subDays(26 * 4), - 'note' => now()->subDays(30 + 26 * 4)->format('d. M') . ' - ' . now()->subDays(26 * 4)->format('d. M'), - 'amount' => $isHowdy ? 7.42 : random_int(1, 20), - 'driver' => 'system', - ], - [ - 'type' => 'charge', - 'created_at' => now()->subDays(26 * 5), - 'note' => 'Account Fund', - 'amount' => $isHowdy ? 50.00 : random_int(1, 20), - 'driver' => 'paypal', - ], - ])->each( - function ($transaction) use ($user, $plan) { - $bandwidthUsage = random_int(1000, 12000) / 1000; - $storageUsage = random_int(300, 4900) / 1000; - $memberUsage = random_int(3, 20); - - $user->transactions()->create([ - 'type' => $transaction['type'], - 'status' => 'completed', - 'note' => $transaction['note'], - 'currency' => $plan->currency, - 'driver' => $transaction['driver'], - 'amount' => $transaction['amount'], - 'created_at' => $transaction['created_at'], - 'reference' => Str::random(12), - 'metadata' => $transaction['type'] === 'withdrawal' - ? [ - [ - 'feature' => 'bandwidth', - 'amount' => 0.29 * $bandwidthUsage, - 'usage' => $bandwidthUsage, - ], - [ - 'feature' => 'storage', - 'amount' => 0.19 * $storageUsage, - 'usage' => $storageUsage, - ], - [ - 'feature' => 'flatFee', - 'amount' => 2.49, - 'usage' => 1, - ], - [ - 'feature' => 'member', - 'amount' => 0.10 * $memberUsage, - 'usage' => $memberUsage, - ], - ] - : null, - ]); - } - ); - - // Make fake credit card - $creditCard = CreditCard::factory() - ->make(); - - // 6. Store credit card - if (! $isHowdy) { - $user->creditCards()->create([ - 'brand' => $creditCard->brand, - 'last4' => $creditCard->last4, - 'service' => $creditCard->service, - 'reference' => $creditCard->reference, - 'expiration' => $creditCard->expiration, - ]); - } - - // 7. Add default user balance - $user->balance()->create([ - 'currency' => 'USD', - 'amount' => $isHowdy ? 30.60 : random_int(20, 60), - ]); - - // 8. Create billing alert - $user->billingAlert()->create([ - 'amount' => $isHowdy ? 25 : random_int(30, 80), - ]); - }); - } - - public function generateFixedSubscription(): void - { - $howdy = User::where('email', 'howdy@hi5ve.digital') - ->first(); - - $alice = User::where('email', 'alice@hi5ve.digital') - ->first(); - - $johan = User::where('email', 'johan@hi5ve.digital') - ->first(); - - $professionalPackPlan = Plan::where('name', 'Professional Pack') - ->where('interval', 'month') - ->first(); - - $businessPackPlan = Plan::where('name', 'Business Pack') - ->where('interval', 'month') - ->first(); - - $this->info("Storing {$professionalPackPlan->name} for {$howdy->email}..."); - - $howdySubscription = $howdy->subscription()->create([ - 'plan_id' => $professionalPackPlan->id, - 'name' => $professionalPackPlan->name, - 'status' => 'active', - 'created_at' => now()->subDays(14), - 'updated_at' => now()->subDays(14), - ]); - - $this->info("Storing {$businessPackPlan->name} for {$alice->email}..."); - - $aliceSubscription = $alice->subscription()->create([ - 'plan_id' => $businessPackPlan->id, - 'name' => $businessPackPlan->name, - 'status' => 'active', - 'created_at' => now()->subDays(9), - 'updated_at' => now()->subDays(9), - ]); - - $this->info("Storing {$professionalPackPlan->name} for {$johan->email}..."); - - $johanSubscription = $johan->subscription()->create([ - 'plan_id' => $professionalPackPlan->id, - 'name' => $professionalPackPlan->name, - 'status' => 'cancelled', - 'ends_at' => now()->addDays(18), - 'created_at' => now()->subDays(8), - 'updated_at' => now()->subDays(8), - ]); - - $this->info("Storing transactions for {$howdy->email}..."); - - collect([ - ['created_at' => now()->subDays(2)], - ['created_at' => now()->subDays(26)], - ['created_at' => now()->subDays(26 * 2)], - ['created_at' => now()->subDays(26 * 3)], - ['created_at' => now()->subDays(26 * 4)], - ['created_at' => now()->subDays(26 * 5)], - ])->each( - fn ($transaction) => $howdy->transactions()->create([ - 'status' => 'completed', - 'note' => $professionalPackPlan->name, - 'currency' => $professionalPackPlan->currency, - 'amount' => $professionalPackPlan->amount, - 'driver' => 'paypal', - 'created_at' => $transaction['created_at'], - 'reference' => Str::random(12), - ]) - ); - - $this->info("Storing transactions for {$johan->email}..."); - - collect([ - ['created_at' => now()->subDay()], - ['created_at' => now()->subDays(29)], - ['created_at' => now()->subDays(29 * 2)], - ['created_at' => now()->subDays(29 * 3)], - ])->each( - fn ($transaction) => $johan->transactions()->create([ - 'status' => 'completed', - 'note' => $professionalPackPlan->name, - 'currency' => $professionalPackPlan->currency, - 'amount' => $professionalPackPlan->amount, - 'driver' => 'stripe', - 'created_at' => $transaction['created_at'], - 'reference' => Str::random(12), - ]) - ); - - $this->info("Storing transactions for {$alice->email}..."); - - collect([ - ['created_at' => now()], - ['created_at' => now()->subDays(28)], - ['created_at' => now()->subDays(28 * 2)], - ['created_at' => now()->subDays(28 * 3)], - ['created_at' => now()->subDays(28 * 4)], - ])->each( - fn ($transaction) => $alice->transactions()->create([ - 'status' => 'completed', - 'note' => $businessPackPlan->name, - 'currency' => $businessPackPlan->currency, - 'amount' => $businessPackPlan->amount, - 'driver' => 'paystack', - 'created_at' => $transaction['created_at'], - 'reference' => Str::random(12), - ]) - ); - - $howdySubscription->driver()->create([ - 'driver' => 'stripe', - 'driver_subscription_id' => Str::random(), - ]); - - // Make fake credit card - $creditCard = CreditCard::factory() - ->make(); - - // 6. Store credit card - $howdy->creditCards()->create([ - 'brand' => $creditCard->brand, - 'last4' => $creditCard->last4, - 'service' => $creditCard->service, - 'reference' => $creditCard->reference, - 'expiration' => $creditCard->expiration, - ]); - - $aliceSubscription->driver()->create([ - 'driver' => 'paystack', - 'driver_subscription_id' => Str::random(), - ]); - - $johanSubscription->driver()->create([ - 'driver' => 'stripe', - 'driver_subscription_id' => Str::random(), - ]); - } - - public function generateFixedPlans() - { - // Define plans - $plans = [ - [ - 'type' => 'fixed', - 'name' => 'Professional Pack', - 'description' => 'Best for all professionals', - 'currency' => 'USD', - 'features' => [ - 'max_storage_amount' => 200, - 'max_team_members' => 20, - ], - 'intervals' => [ - [ - 'interval' => 'month', - 'amount' => 9.99, - ], - [ - 'interval' => 'year', - 'amount' => 99.49, - ], - ], - ], - [ - 'type' => 'fixed', - 'name' => 'Business Pack', - 'description' => 'Best for business needs', - 'currency' => 'USD', - 'features' => [ - 'max_storage_amount' => 500, - 'max_team_members' => 50, - ], - 'intervals' => [ - [ - 'interval' => 'month', - 'amount' => 29.99, - ], - [ - 'interval' => 'year', - 'amount' => 189.99, - ], - ], - ], - [ - 'type' => 'fixed', - 'name' => 'Elite Pack', - 'description' => 'Best for all your needs', - 'currency' => 'USD', - 'features' => [ - 'max_storage_amount' => 2000, - 'max_team_members' => -1, - ], - 'intervals' => [ - [ - 'interval' => 'month', - 'amount' => 59.99, - ], - [ - 'interval' => 'year', - 'amount' => 349.99, - ], - ], - ], - ]; - - // Create plans - foreach ($plans as $plan) { - foreach ($plan['intervals'] as $interval) { - $data = CreateFixedPlanData::fromArray([ - 'type' => $plan['type'], - 'name' => $plan['name'], - 'description' => $plan['description'], - 'features' => $plan['features'], - 'currency' => $plan['currency'], - 'amount' => $interval['amount'], - 'interval' => $interval['interval'], - ]); - - $this->info("Creating plan with name: {$plan['name']} and interval: {$interval['interval']}"); - - // Store plans to the database and gateway - ($this->storeFixedPlan)($data); - } - } - } - - public function generateMeteredPlans() - { - // Define plans - $plans = [ - [ - 'type' => 'metered', - 'name' => 'Pay as You Go', - 'description' => 'Best for all professionals', - 'currency' => 'USD', - 'meters' => [ - [ - 'key' => 'bandwidth', - 'aggregate_strategy' => 'sum_of_usage', - 'tiers' => [ - [ - 'first_unit' => 1, - 'last_unit' => null, - 'per_unit' => 0.29, - 'flat_fee' => null, - ], - ], - ], - [ - 'key' => 'storage', - 'aggregate_strategy' => 'maximum_usage', - 'tiers' => [ - [ - 'first_unit' => 1, - 'last_unit' => null, - 'per_unit' => 0.19, - 'flat_fee' => null, - ], - ], - ], - [ - 'key' => 'flatFee', - 'aggregate_strategy' => 'maximum_usage', - 'tiers' => [ - [ - 'first_unit' => 1, - 'last_unit' => null, - 'per_unit' => 2.49, - 'flat_fee' => null, - ], - ], - ], - [ - 'key' => 'member', - 'aggregate_strategy' => 'maximum_usage', - 'tiers' => [ - [ - 'first_unit' => 1, - 'last_unit' => null, - 'per_unit' => 0.10, - 'flat_fee' => null, - ], - ], - ], - ], - ], - ]; - - // Create plans - foreach ($plans as $plan) { - $data = CreateMeteredPlanData::fromArray([ - 'type' => $plan['type'], - 'name' => $plan['name'], - 'meters' => $plan['meters'], - 'currency' => $plan['currency'], - 'description' => $plan['description'], - ]); - - $this->info("Creating plan with name: {$plan['name']}"); - - // Store plans to the database and gateway - ($this->storeMeteredPlan)($data); - } - } -} diff --git a/src/App/Console/Commands/SetupWebsocketEnvironment.php b/src/App/Console/Commands/SetupWebsocketEnvironment.php deleted file mode 100644 index 7cd5aba5..00000000 --- a/src/App/Console/Commands/SetupWebsocketEnvironment.php +++ /dev/null @@ -1,47 +0,0 @@ -ask('Type host of which you want to allow incoming requests. If you want to accept multiple hosts, separate them with comma(,)'); - - // Store origins to the .env file - setEnvironmentValue([ - 'PUSHER_APP_ALLOWED_ORIGIN' => $origins, - 'APP_ENV' => 'production', - 'APP_DEBUG' => 'false', - ]); - - $this->info('Your host/s was stored successfully.'); - - // Generate new app key - $this->call('key:generate', [ - '--force' => true, - ]); - - // Clear cache - $this->call('config:clear'); - - $this->info('Everything is done, congratulations! 🥳🥳🥳'); - } -} diff --git a/src/App/Socialite/Controllers/SocialiteCallbackController.php b/src/App/Socialite/Controllers/SocialiteCallbackController.php deleted file mode 100644 index e3d77fe6..00000000 --- a/src/App/Socialite/Controllers/SocialiteCallbackController.php +++ /dev/null @@ -1,87 +0,0 @@ -runningUnitTests()) { - $socialite = Socialite::driver($provider)->user(); - } else { - $socialite = Socialite::driver($provider)->stateless()->user(); - } - - // Get user by email - $user = User::where('email', $socialite->email); - - // Login user when exists - if ($user->exists()) { - $this->guard->login( - $user->first() - ); - - return redirect()->to('/platform/files'); - } - - // Check for metered billing plan - if (get_settings('subscription_type') === 'metered') { - // Get metered plan - $plan = Plan::where('status', 'active') - ->where('type', 'metered'); - - // TODO: redirect to the error page - if ($plan->doesntExist()) { - return response([ - 'type' => 'error', - 'message' => 'User registrations are temporarily disabled', - ], 409); - } - } - - // Check if account registration is enabled - if (! $isAllowedRegistration) { - return response([ - 'type' => 'error', - 'message' => 'User registration is not allowed', - ], 401); - } - - // Create data user data object - $data = CreateUserData::fromArray([ - 'role' => 'user', - 'name' => $socialite->getName(), - 'email' => $socialite->getEmail(), - 'avatar' => store_socialite_avatar($socialite->getAvatar()), - 'oauth_provider' => $provider, - ]); - - // Create User - $newUser = ($this->createNewUser)($data); - - // Login user - $this->guard->login($newUser); - - return redirect()->to('/platform/files'); - } -} diff --git a/src/App/Socialite/Controllers/SocialiteRedirectController.php b/src/App/Socialite/Controllers/SocialiteRedirectController.php deleted file mode 100644 index 718b47d0..00000000 --- a/src/App/Socialite/Controllers/SocialiteRedirectController.php +++ /dev/null @@ -1,17 +0,0 @@ -stateless()->redirect()->getTargetUrl(); - - return response()->json([ - 'url' => $url, - ]); - } -} diff --git a/src/App/Users/Actions/AutoSubscribeForMeteredBillingAction.php b/src/App/Users/Actions/AutoSubscribeForMeteredBillingAction.php deleted file mode 100644 index 525172e9..00000000 --- a/src/App/Users/Actions/AutoSubscribeForMeteredBillingAction.php +++ /dev/null @@ -1,62 +0,0 @@ -where('type', 'metered') - ->first(); - - // Get settings - $settings = get_settings([ - 'allowed_registration_bonus', - 'registration_bonus_amount', - ]); - - // Create user balance - if (intval($settings['allowed_registration_bonus'])) { - // Create balance with bonus amount - $user->balance()->create([ - 'amount' => $settings['registration_bonus_amount'], - 'currency' => $plan->currency, - ]); - - // Store transaction bonus - $user->transactions()->create([ - 'status' => 'completed', - 'type' => 'credit', - 'driver' => 'system', - 'note' => __t('registration_bonus'), - 'currency' => $plan->currency, - 'amount' => $settings['registration_bonus_amount'], - ]); - - // Send user bonus notification - $bonus = format_currency($settings['registration_bonus_amount'], $plan->currency); - - $user->notify(new RegistrationBonusAddedNotification($bonus)); - } else { - // Create balance with 0 amount - $user->balance()->create([ - 'amount' => 0, - 'currency' => $plan->currency, - ]); - } - - // Create user subscription - $user->subscription()->create([ - 'plan_id' => $plan->id, - 'name' => $plan->name, - 'status' => 'active', - 'renews_at' => now()->addDays(config('subscription.metered_billing.settlement_period')), - 'type' => 'pre-paid', - ]); - } -} diff --git a/src/App/Users/Actions/FormatUsageEstimatesAction.php b/src/App/Users/Actions/FormatUsageEstimatesAction.php deleted file mode 100644 index 1dc322bc..00000000 --- a/src/App/Users/Actions/FormatUsageEstimatesAction.php +++ /dev/null @@ -1,30 +0,0 @@ -mapWithKeys(function ($estimate) use ($currency) { - // Format usage - $usage = match ($estimate['feature']) { - 'bandwidth', 'storage' => Metric::megabytes($estimate['usage'] * 1000)->format(), - 'flatFee' => intval($estimate['usage']) . ' ' . __t('pcs.'), - 'member' => intval($estimate['usage']) . ' ' . __t('mem.'), - }; - - return [ - $estimate['feature'] => [ - 'feature' => $estimate['feature'], - 'amount' => $estimate['amount'], - 'cost' => format_currency($estimate['amount'], $currency), - 'usage' => $usage, - ], - ]; - }); - } -} diff --git a/src/App/Users/Notifications/RegistrationBonusAddedNotification.php b/src/App/Users/Notifications/RegistrationBonusAddedNotification.php deleted file mode 100644 index c9520883..00000000 --- a/src/App/Users/Notifications/RegistrationBonusAddedNotification.php +++ /dev/null @@ -1,41 +0,0 @@ - 'gift', - 'title' => __t('you_received_bonus', ['bonus' => $this->bonus]), - 'description' => __t('you_received_registration_bonus_note', ['bonus' => $this->bonus]), - ]; - } -} diff --git a/src/App/Users/Resources/UserSubscription.php b/src/App/Users/Resources/UserSubscription.php deleted file mode 100644 index 81cbe05e..00000000 --- a/src/App/Users/Resources/UserSubscription.php +++ /dev/null @@ -1,42 +0,0 @@ -subscription('main') - ->asStripeSubscription(); - - // TODO: vybrat z cache - $subscription = resolve('App\Services\StripeService') - ->getPlan($this->subscription('main')->stripe_plan); - - return [ - 'data' => [ - 'id' => $subscription['plan']['id'], - 'type' => 'subscription', - 'attributes' => [ - 'incomplete' => $this->subscription('main')->incomplete(), - 'active' => $this->subscription('main')->active(), - 'canceled' => $this->subscription('main')->cancelled(), - 'name' => $subscription['product']['name'], - 'capacity' => (int) $subscription['product']['metadata']['capacity'], - 'capacity_formatted' => format_gigabytes($subscription['product']['metadata']['capacity']), - 'slug' => $subscription['plan']['id'], - 'canceled_at' => format_date($active_subscription['canceled_at'], 'd. M. Y'), - 'created_at' => format_date($active_subscription['current_period_start'], 'd. M. Y'), - 'ends_at' => format_date($active_subscription['current_period_end'], 'd. M. Y'), - ], - ], - ]; - } -} diff --git a/src/App/Users/Restrictions/Engines/FixedBillingRestrictionsEngine.php b/src/App/Users/Restrictions/Engines/FixedBillingRestrictionsEngine.php deleted file mode 100644 index b8630417..00000000 --- a/src/App/Users/Restrictions/Engines/FixedBillingRestrictionsEngine.php +++ /dev/null @@ -1,46 +0,0 @@ -usedCapacity + $fileSize, - maxAmount: $user->limitations->max_storage_amount, - ); - - // Check if storage usage exceed predefined capacity - return ! ($usedPercentage >= 100); - } - - public function canDownload(User $user): bool - { - return true; - } - - public function canCreateFolder(User $user): bool - { - return true; - } - - public function canCreateTeamFolder(User $user): bool - { - return true; - } - - public function canInviteTeamMembers(User $user, array $newInvites = []): bool - { - return resolve(CheckMaxTeamMembersLimitAction::class)($user, $newInvites); - } - - public function canVisitShared(User $user): bool - { - return true; - } -} diff --git a/src/App/Users/Restrictions/Engines/MeteredBillingRestrictionsEngine.php b/src/App/Users/Restrictions/Engines/MeteredBillingRestrictionsEngine.php deleted file mode 100644 index 07f594b0..00000000 --- a/src/App/Users/Restrictions/Engines/MeteredBillingRestrictionsEngine.php +++ /dev/null @@ -1,43 +0,0 @@ -failedPayments()->count() >= 3); - } - - public function canDownload(User $user): bool - { - // Disable download when user has more than 3 failed payments - return ! ($user->failedPayments()->count() >= 3); - } - - public function canCreateFolder(User $user): bool - { - // Disable create folder when user has more than 3 failed payments - return ! ($user->failedPayments()->count() >= 3); - } - - public function canCreateTeamFolder(User $user): bool - { - // Disable create folder when user has more than 3 failed payments - return ! ($user->failedPayments()->count() >= 3); - } - - public function canInviteTeamMembers(User $user, array $newInvites = []): bool - { - return true; - } - - public function canVisitShared(User $user): bool - { - // Disable share visit when user has more than 3 failed payments - return ! ($user->failedPayments()->count() >= 3); - } -} diff --git a/src/App/Users/Restrictions/RestrictionsManager.php b/src/App/Users/Restrictions/RestrictionsManager.php index 1ab7c84f..f4f3f3bf 100644 --- a/src/App/Users/Restrictions/RestrictionsManager.php +++ b/src/App/Users/Restrictions/RestrictionsManager.php @@ -10,21 +10,11 @@ class RestrictionsManager extends Manager { public function getDefaultDriver(): string { - return get_restriction_driver(); + return 'default'; } public function createDefaultDriver(): DefaultRestrictionsEngine { return new DefaultRestrictionsEngine(); } - - public function createFixedDriver(): FixedBillingRestrictionsEngine - { - return new FixedBillingRestrictionsEngine(); - } - - public function createMeteredDriver(): MeteredBillingRestrictionsEngine - { - return new MeteredBillingRestrictionsEngine(); - } } diff --git a/src/Domain/Admin/Controllers/Dashboard/GetLatestTransactionsController.php b/src/Domain/Admin/Controllers/Dashboard/GetLatestTransactionsController.php deleted file mode 100644 index e1b9af6d..00000000 --- a/src/Domain/Admin/Controllers/Dashboard/GetLatestTransactionsController.php +++ /dev/null @@ -1,20 +0,0 @@ - 'desc', - ]) - ->take(5) - ->get(); - - return new TransactionCollection($transactions); - } -} diff --git a/src/Domain/Files/Requests/RemoteUploadRequest.php b/src/Domain/Files/Requests/RemoteUploadRequest.php deleted file mode 100644 index 24426059..00000000 --- a/src/Domain/Files/Requests/RemoteUploadRequest.php +++ /dev/null @@ -1,30 +0,0 @@ - 'required|url', - 'parent_id' => 'nullable|uuid', - ]; - } -} diff --git a/src/Domain/Files/Requests/UploadRequest.php b/src/Domain/Files/Requests/UploadRequest.php deleted file mode 100644 index 7224374d..00000000 --- a/src/Domain/Files/Requests/UploadRequest.php +++ /dev/null @@ -1,35 +0,0 @@ - 'required|string', - 'parent_id' => 'nullable|uuid', - 'path' => 'sometimes|string', - 'is_last' => 'sometimes|string', - 'extension' => 'sometimes|string|nullable', - 'file' => ['required', 'file', new DisabledMimetypes], - ]; - } -} diff --git a/src/Domain/Homepage/Controllers/SendContactMessageController.php b/src/Domain/Homepage/Controllers/SendContactMessageController.php deleted file mode 100644 index 766d3bce..00000000 --- a/src/Domain/Homepage/Controllers/SendContactMessageController.php +++ /dev/null @@ -1,30 +0,0 @@ -send(new SendContactMessage($request->all())); - } - - return response('Done', 201); - } -} diff --git a/src/Domain/Homepage/Mail/SendContactMessage.php b/src/Domain/Homepage/Mail/SendContactMessage.php deleted file mode 100644 index b1f68dfb..00000000 --- a/src/Domain/Homepage/Mail/SendContactMessage.php +++ /dev/null @@ -1,28 +0,0 @@ -from(config('mail.from')['address']) - ->replyTo($this->request['email']) - ->subject('New Contact Message from ' . $this->request['email']) - ->view('mails.contact-message') - ->with('request', $this->request); - } -} diff --git a/src/Domain/Homepage/Requests/SendContactMessageRequest.php b/src/Domain/Homepage/Requests/SendContactMessageRequest.php deleted file mode 100644 index e97cce1a..00000000 --- a/src/Domain/Homepage/Requests/SendContactMessageRequest.php +++ /dev/null @@ -1,33 +0,0 @@ - 'required|email', - 'message' => 'required|string', - 'reCaptcha' => [new RequiredIf(get_settings('allowed_recaptcha') == 1), 'string', 'nullable', app(ReCaptchaRules::class)], - ]; - } -} diff --git a/src/Domain/Invoices/Controllers/GetInvoiceController.php b/src/Domain/Invoices/Controllers/GetInvoiceController.php deleted file mode 100644 index ad017a2a..00000000 --- a/src/Domain/Invoices/Controllers/GetInvoiceController.php +++ /dev/null @@ -1,37 +0,0 @@ -pluck('value', 'name') - ); - - // Format metadata - if ($invoice->metadata) { - $invoice->metadata = ($this->formatUsageEstimates)($invoice->currency, $invoice->metadata); - } - - // Return invoice view - return view('vuefilemanager.invoice') - ->with('settings', $settings) - ->with('invoice', $invoice); - } -} diff --git a/src/Domain/Notifications/Controllers/FlushUserNotificationsController.php b/src/Domain/Notifications/Controllers/FlushUserNotificationsController.php deleted file mode 100644 index 31649db7..00000000 --- a/src/Domain/Notifications/Controllers/FlushUserNotificationsController.php +++ /dev/null @@ -1,22 +0,0 @@ -user()->notifications()->delete(); - - return response('Done', 204); - } -} diff --git a/src/Domain/Notifications/Controllers/GetUserNotificationsController.php b/src/Domain/Notifications/Controllers/GetUserNotificationsController.php deleted file mode 100644 index 6281726f..00000000 --- a/src/Domain/Notifications/Controllers/GetUserNotificationsController.php +++ /dev/null @@ -1,15 +0,0 @@ -user()->notifications - ); - } -} diff --git a/src/Domain/Notifications/Controllers/MarkUserNotificationsAsReadController.php b/src/Domain/Notifications/Controllers/MarkUserNotificationsAsReadController.php deleted file mode 100644 index b886a8d4..00000000 --- a/src/Domain/Notifications/Controllers/MarkUserNotificationsAsReadController.php +++ /dev/null @@ -1,22 +0,0 @@ -user()->unreadNotifications()->update(['read_at' => now()]); - - return response('Done', 204); - } -} diff --git a/src/Domain/Notifications/Resources/NotificationCollection.php b/src/Domain/Notifications/Resources/NotificationCollection.php deleted file mode 100644 index 0fc61583..00000000 --- a/src/Domain/Notifications/Resources/NotificationCollection.php +++ /dev/null @@ -1,16 +0,0 @@ - $this->collection, - ]; - } -} diff --git a/src/Domain/Notifications/Resources/NotificationResource.php b/src/Domain/Notifications/Resources/NotificationResource.php deleted file mode 100644 index 2c09f018..00000000 --- a/src/Domain/Notifications/Resources/NotificationResource.php +++ /dev/null @@ -1,31 +0,0 @@ - [ - 'id' => $this->id, - 'type' => $this->type, - 'attributes' => [ - 'category' => $this->data['category'], - 'title' => $this->data['title'], - 'description' => $this->data['description'], - 'action' => $this->data['action'] ?? null, - 'created_at' => format_date($this->created_at, 'd. M. Y h:i'), - 'read_at' => $this->read_at ? format_date($this->read_at, 'd. M. Y h:i') : null, - ], - ], - ]; - } -} diff --git a/src/Domain/Pages/Actions/SeedDefaultPagesAction.php b/src/Domain/Pages/Actions/SeedDefaultPagesAction.php deleted file mode 100644 index 9ac7238b..00000000 --- a/src/Domain/Pages/Actions/SeedDefaultPagesAction.php +++ /dev/null @@ -1,16 +0,0 @@ -each(fn ($page) => Page::updateOrCreate($page)); - } -} diff --git a/src/Domain/Pages/Controllers/AdminPagesController.php b/src/Domain/Pages/Controllers/AdminPagesController.php deleted file mode 100644 index 3ae72d99..00000000 --- a/src/Domain/Pages/Controllers/AdminPagesController.php +++ /dev/null @@ -1,49 +0,0 @@ -paginate(10) - ); - } - - /** - * Get single page resource - */ - public function show(Page $page): PageResource - { - return new PageResource($page); - } - - /** - * Update page content - */ - public function update(Request $request, Page $page): Response - { - // Abort in demo mode - abort_if(is_demo(), 204, 'Done.'); - - $page->update( - make_single_input($request) - ); - - return response( - new PageResource($page), - 204 - ); - } -} diff --git a/src/Domain/Pages/Controllers/PagesController.php b/src/Domain/Pages/Controllers/PagesController.php deleted file mode 100644 index 17a37c3e..00000000 --- a/src/Domain/Pages/Controllers/PagesController.php +++ /dev/null @@ -1,17 +0,0 @@ - $this->collection, - ]; - } -} diff --git a/src/Domain/Pages/Resources/PageResource.php b/src/Domain/Pages/Resources/PageResource.php deleted file mode 100644 index d0956a13..00000000 --- a/src/Domain/Pages/Resources/PageResource.php +++ /dev/null @@ -1,30 +0,0 @@ - [ - 'id' => $this->slug, - 'type' => 'pages', - 'attributes' => [ - 'visibility' => $this->visibility, - 'title' => $this->title, - 'slug' => $this->slug, - 'content' => $this->content, - 'content_formatted' => add_paragraphs($this->content), - ], - ], - ]; - } -} diff --git a/src/Domain/RemoteUpload/Actions/GetContentFromExternalSource.php b/src/Domain/RemoteUpload/Actions/GetContentFromExternalSource.php deleted file mode 100644 index 24673c5c..00000000 --- a/src/Domain/RemoteUpload/Actions/GetContentFromExternalSource.php +++ /dev/null @@ -1,143 +0,0 @@ -checkDisabledMimetypes($extension); - - // Get file basename - $basename = Str::uuid() . ".$extension"; - - // Get file name - $name = array_key_exists('filename', pathinfo($url)) - ? explode('?', pathinfo($url)['filename'])[0] - : Str::uuid(); - - // Get file path - $path = "files/$user->id/$basename"; - - // Store file to main storage disk - $localDisk->put($path, $response->getBody()); - - // Create multiple image thumbnails - ($this->createImageThumbnail)($basename, $user->id); - - // Store file exif information - $exif = ($this->storeExifData)($path); - - // Create new file - $file = File::create([ - 'mimetype' => $extension, - 'type' => getFileType($localDisk->mimeType($path)), - 'parent_id' => $payload['parent_id'] ?? null, - 'name' => $name ?? $basename, - 'basename' => $basename, - 'filesize' => $localDisk->size($path), - 'user_id' => $user->id, - 'creator_id' => auth()->id(), - ]); - - // Attach file into the exif data - $exif?->update(['file_id' => $file->id]); - - // Move file to external storage - match (config('filesystems.default')) { - 's3' => ($this->moveFileToExternalStorage)($basename, $user->id), - 'ftp', 'azure' => ($this->moveFileToFTPStorage)($basename, $user->id), - default => null - }; - - // Increment processed items count - $processed++; - - // Broadcast new file into the frontend - RemoteFileCreatedEvent::dispatch([ - 'progress' => [ - 'total' => $total, - 'processed' => $processed, - 'failed' => $failed, - ], - 'file' => new FileResource($file), - ]); - } catch (ErrorException | Error $e) { - // Increment items count - $processed++; - $failed++; - - // Broadcast new file into the frontend - RemoteFileCreatedEvent::dispatch([ - 'progress' => [ - 'total' => $total, - 'processed' => $processed, - 'failed' => $failed, - ], - 'file' => null, - ]); - - Log::error("Remote upload failed as {$e->getMessage()}"); - Log::error($e->getTraceAsString()); - } - } - } - - /** - * @param string|null $extension - */ - protected function checkDisabledMimetypes(?string $extension): void - { - $mimetypeBlacklist = explode(',', get_settings('mimetypes_blacklist')) ?? null; - - // If is extension in mimetype blacklist, Abort! - if ($extension && array_intersect([str_replace('.', '', ".$extension")], $mimetypeBlacklist)) { - abort(422); - } - } -} diff --git a/src/Domain/RemoteUpload/Controllers/RemoteUploadFileController.php b/src/Domain/RemoteUpload/Controllers/RemoteUploadFileController.php deleted file mode 100644 index ee4df71f..00000000 --- a/src/Domain/RemoteUpload/Controllers/RemoteUploadFileController.php +++ /dev/null @@ -1,42 +0,0 @@ -filled('parent_id') - ? Folder::find($request->input('parent_id')) - ->getLatestParent() - ->user - : auth()->user(); - - // Get content from external sources - if (isBroadcasting()) { - ($this->getContentFromExternalSource) - ->onQueue() - ->execute($request->all(), $user); - } else { - ($this->getContentFromExternalSource)($request->all(), $user); - } - - return response('Files were successfully added to the upload queue', 201); - } -} diff --git a/src/Domain/RemoteUpload/Controllers/UploadFilesRemotelyForUploadRequestController.php b/src/Domain/RemoteUpload/Controllers/UploadFilesRemotelyForUploadRequestController.php deleted file mode 100644 index e342798f..00000000 --- a/src/Domain/RemoteUpload/Controllers/UploadFilesRemotelyForUploadRequestController.php +++ /dev/null @@ -1,74 +0,0 @@ -id); - - // Create folder if not exist - if ($folder->doesntExist()) { - $this->createFolder($uploadRequest); - } - - // Set default parent_id for uploaded file - if (is_null($request->input('parent_id'))) { - $request->merge(['parent_id' => $uploadRequest->id]); - } - - // Get content from external sources - if (isBroadcasting()) { - ($this->getContentFromExternalSource) - ->onQueue() - ->execute($request->all(), $uploadRequest->user); - } else { - ($this->getContentFromExternalSource)($request->all(), $uploadRequest->user); - } - - // Set timestamp for auto filling - cache()->set("auto-filling.$uploadRequest->id", now()->toString()); - - return response('Files were successfully added to the upload queue', 201); - } - - /** - * Create root Upload Request folder - */ - private function createFolder(UploadRequest $uploadRequest): void - { - // Format timestamp - $timestamp = format_date($uploadRequest->created_at, 'd. M. Y'); - - // Create folder - DB::table('folders')->insert([ - 'id' => $uploadRequest->id, - 'parent_id' => $uploadRequest->folder_id ?? null, - 'user_id' => $uploadRequest->user_id, - 'name' => $uploadRequest->name ?? __t('upload_request_default_folder', ['timestamp' => $timestamp]), - 'created_at' => now(), - 'updated_at' => now(), - ]); - - // Update upload request status - $uploadRequest->update([ - 'status' => 'filling', - ]); - } -} diff --git a/src/Domain/RemoteUpload/Controllers/VisitorRemoteUploadFileController.php b/src/Domain/RemoteUpload/Controllers/VisitorRemoteUploadFileController.php deleted file mode 100644 index f2864a61..00000000 --- a/src/Domain/RemoteUpload/Controllers/VisitorRemoteUploadFileController.php +++ /dev/null @@ -1,45 +0,0 @@ -protectShareRecord)($shared); - - // Check shared permission - if (is_visitor($shared)) { - abort(403, "You don't have access to this item"); - } - - // Check access to requested directory - ($this->verifyAccessToItem)($request->input('parent_id'), $shared); - - // Get content from external sources - if (isBroadcasting()) { - ($this->getContentFromExternalSource) - ->onQueue() - ->execute($request->all(), $shared->user); - } else { - ($this->getContentFromExternalSource)($request->all(), $shared->user); - } - - return response('Files were successfully added to the upload queue', 201); - } -} diff --git a/src/Domain/RemoteUpload/Events/RemoteFileCreatedEvent.php b/src/Domain/RemoteUpload/Events/RemoteFileCreatedEvent.php deleted file mode 100644 index 9643cbeb..00000000 --- a/src/Domain/RemoteUpload/Events/RemoteFileCreatedEvent.php +++ /dev/null @@ -1,39 +0,0 @@ -payload['file']->user_id}"); - } -} diff --git a/src/Domain/Settings/Controllers/StoreBroadcastServiceCredentialsController.php b/src/Domain/Settings/Controllers/StoreBroadcastServiceCredentialsController.php deleted file mode 100644 index fd393e39..00000000 --- a/src/Domain/Settings/Controllers/StoreBroadcastServiceCredentialsController.php +++ /dev/null @@ -1,59 +0,0 @@ -runningUnitTests()) { - $credentials = [ - 'pusher' => [ - 'BROADCAST_DRIVER' => 'pusher', - 'PUSHER_APP_ID' => $request->input('id'), - 'PUSHER_APP_KEY' => $request->input('key'), - 'PUSHER_APP_SECRET' => $request->input('secret'), - 'PUSHER_APP_CLUSTER' => $request->input('cluster'), - 'PUSHER_APP_HOST' => '', - 'PUSHER_APP_PORT' => '', - 'PUSHER_APP_TLS' => true, - ], - 'native' => [ - 'BROADCAST_DRIVER' => 'pusher', - 'PUSHER_APP_ID' => 'local', - 'PUSHER_APP_KEY' => 'local', - 'PUSHER_APP_SECRET' => 'local', - 'PUSHER_APP_CLUSTER' => 'local', - 'PUSHER_APP_HOST' => $request->input('host'), - 'PUSHER_APP_PORT' => '', - 'PUSHER_APP_TLS' => $request->boolean('tls') ? 'true' : 'false', - ], - 'none' => [ - 'BROADCAST_DRIVER' => 'null', - ], - ]; - - // Store credentials into the .env file - setEnvironmentValue($credentials[$request->input('driver')]); - - // Clear cache - if (! is_dev()) { - Artisan::call('cache:clear'); - Artisan::call('config:clear'); - Artisan::call('config:cache'); - } - } - - return response('Done', 204); - } -} diff --git a/src/Domain/Settings/Controllers/StorePaymentServiceCredentialsController.php b/src/Domain/Settings/Controllers/StorePaymentServiceCredentialsController.php deleted file mode 100644 index 35d6ef90..00000000 --- a/src/Domain/Settings/Controllers/StorePaymentServiceCredentialsController.php +++ /dev/null @@ -1,80 +0,0 @@ - [ - 'name' => 'allowed_stripe', - 'value' => 1, - ], - 'paypal' => [ - 'name' => 'allowed_paypal', - 'value' => 1, - ], - 'paystack' => [ - 'name' => 'allowed_paystack', - 'value' => 1, - ], - ]; - - // Get options - collect([$options[$request->input('service')]]) - ->each(fn ($setting) => Setting::updateOrCreate([ - 'name' => $setting['name'], - ], [ - 'value' => $setting['value'], - ])); - - $PayPalDefaultMode = config('subscription.credentials.paypal.is_live') ? 'true' : 'false'; - - // Get and store credentials - if (! app()->runningUnitTests()) { - $credentials = [ - 'stripe' => [ - 'STRIPE_PUBLIC_KEY' => $request->input('key'), - 'STRIPE_SECRET_KEY' => $request->input('secret'), - 'STRIPE_WEBHOOK_SECRET' => $request->input('webhook'), - ], - 'paystack' => [ - 'PAYSTACK_PUBLIC_KEY' => $request->input('key'), - 'PAYSTACK_SECRET' => $request->input('secret'), - ], - 'paypal' => [ - 'PAYPAL_CLIENT_ID' => $request->input('key'), - 'PAYPAL_CLIENT_SECRET' => $request->input('secret'), - 'PAYPAL_WEBHOOK_ID' => $request->input('webhook'), - 'PAYPAL_IS_LIVE' => $request->has('live') ? (string) $request->input('live') : $PayPalDefaultMode, - ], - ]; - - // Store credentials into the .env file - setEnvironmentValue($credentials[$request->input('service')]); - - // Call plan synchronization for makingcg/subscription package - cache()->add('action.synchronize-plans', now()->toString()); - - // Clear cache - if (! is_dev()) { - Artisan::call('cache:clear'); - Artisan::call('config:clear'); - Artisan::call('config:cache'); - } - } - - return response('Done', 204); - } -} diff --git a/src/Domain/Settings/Controllers/StoreSocialServiceCredentialsController.php b/src/Domain/Settings/Controllers/StoreSocialServiceCredentialsController.php deleted file mode 100644 index 2dcee8a1..00000000 --- a/src/Domain/Settings/Controllers/StoreSocialServiceCredentialsController.php +++ /dev/null @@ -1,60 +0,0 @@ - "allowed_{$request->input('service')}", - ], [ - 'value' => 1, - ]); - - // Get and store credentials - if (! app()->runningUnitTests()) { - $credentials = [ - 'facebook' => [ - 'FACEBOOK_CLIENT_ID' => $request->input('client_id'), - 'FACEBOOK_CLIENT_SECRET' => $request->input('client_secret'), - ], - 'google' => [ - 'GOOGLE_CLIENT_ID' => $request->input('client_id'), - 'GOOGLE_CLIENT_SECRET' => $request->input('client_secret'), - ], - 'github' => [ - 'GITHUB_CLIENT_ID' => $request->input('client_id'), - 'GITHUB_CLIENT_SECRET' => $request->input('client_secret'), - ], - 'recaptcha' => [ - 'RECAPTCHA_CLIENT_ID' => $request->input('client_id'), - 'RECAPTCHA_CLIENT_SECRET' => $request->input('client_secret'), - ], - ]; - - // Store credentials into the .env file - setEnvironmentValue($credentials[$request->input('service')]); - - // Clear cache - if (! is_dev()) { - Artisan::call('cache:clear'); - Artisan::call('config:clear'); - Artisan::call('config:cache'); - } - } - - return response('Done', 204); - } -} diff --git a/src/Domain/Settings/Requests/StoreBroadcastServiceCredentialsRequest.php b/src/Domain/Settings/Requests/StoreBroadcastServiceCredentialsRequest.php deleted file mode 100644 index ad861564..00000000 --- a/src/Domain/Settings/Requests/StoreBroadcastServiceCredentialsRequest.php +++ /dev/null @@ -1,35 +0,0 @@ - 'required|string', - 'id' => 'sometimes|nullable|string', - 'key' => 'sometimes|nullable|string', - 'secret' => 'sometimes|nullable|string', - 'cluster' => 'sometimes|nullable|string', - 'port' => 'sometimes|nullable|string', - 'host' => 'sometimes|nullable|string', - ]; - } -} diff --git a/src/Domain/Settings/Requests/StorePaymentServiceCredentialsRequest.php b/src/Domain/Settings/Requests/StorePaymentServiceCredentialsRequest.php deleted file mode 100644 index 26086a4c..00000000 --- a/src/Domain/Settings/Requests/StorePaymentServiceCredentialsRequest.php +++ /dev/null @@ -1,32 +0,0 @@ - 'required|string', - 'secret' => 'required|string', - 'webhook' => 'sometimes|string', - 'live' => 'sometimes|nullable|boolean', - ]; - } -} diff --git a/src/Domain/Settings/Requests/StoreSocialServiceCredentialsRequest.php b/src/Domain/Settings/Requests/StoreSocialServiceCredentialsRequest.php deleted file mode 100644 index 55f577d1..00000000 --- a/src/Domain/Settings/Requests/StoreSocialServiceCredentialsRequest.php +++ /dev/null @@ -1,31 +0,0 @@ - 'required|string', - 'client_secret' => 'required|string', - 'service' => 'required|string', - ]; - } -} diff --git a/src/Domain/Settings/Requests/UpgradeLicenseRequest.php b/src/Domain/Settings/Requests/UpgradeLicenseRequest.php deleted file mode 100644 index cc642d19..00000000 --- a/src/Domain/Settings/Requests/UpgradeLicenseRequest.php +++ /dev/null @@ -1,29 +0,0 @@ - 'required|string', - ]; - } -} diff --git a/src/Domain/SetupWizard/Requests/StoreStripeBillingRequest.php b/src/Domain/SetupWizard/Requests/StoreStripeBillingRequest.php deleted file mode 100644 index 0c395817..00000000 --- a/src/Domain/SetupWizard/Requests/StoreStripeBillingRequest.php +++ /dev/null @@ -1,36 +0,0 @@ - 'sometimes|nullable|string', - 'billing_postal_code' => 'required|string', - 'billing_vat_number' => 'required|string', - 'billing_address' => 'required|string', - 'billing_country' => 'required|string', - 'billing_state' => 'required|string', - 'billing_city' => 'required|string', - 'billing_name' => 'required|string', - ]; - } -} diff --git a/src/Domain/SetupWizard/Requests/StoreStripeCredentialsRequest.php b/src/Domain/SetupWizard/Requests/StoreStripeCredentialsRequest.php deleted file mode 100644 index 52ed8a08..00000000 --- a/src/Domain/SetupWizard/Requests/StoreStripeCredentialsRequest.php +++ /dev/null @@ -1,32 +0,0 @@ - 'required|string', - 'webhookSecret' => 'required|string', - 'secret' => 'required|string', - 'key' => 'required|string', - ]; - } -} diff --git a/src/Domain/SetupWizard/Requests/StoreStripePlansRequest.php b/src/Domain/SetupWizard/Requests/StoreStripePlansRequest.php deleted file mode 100644 index 61bbbdc5..00000000 --- a/src/Domain/SetupWizard/Requests/StoreStripePlansRequest.php +++ /dev/null @@ -1,34 +0,0 @@ - 'required|array', - 'plans.*.type' => 'required|string', - 'plans.*.attributes.name' => 'required|string', - 'plans.*.attributes.price' => 'required|string', - 'plans.*.attributes.description' => 'sometimes|nullable|string', - 'plans.*.attributes.capacity' => 'required|digits_between:1,9', - ]; - } -} diff --git a/src/Domain/Subscriptions/Notifications/BillingAlertTriggeredNotification.php b/src/Domain/Subscriptions/Notifications/BillingAlertTriggeredNotification.php deleted file mode 100644 index 79a9af87..00000000 --- a/src/Domain/Subscriptions/Notifications/BillingAlertTriggeredNotification.php +++ /dev/null @@ -1,42 +0,0 @@ -subject(__t('billing_alert_reached_long')) - ->greeting(__t('hello')) - ->line(__t('billing_alert_reached_long_note')) - ->action(__t('show_billing'), url('/user/settings/billing')); - } - - public function toArray(): array - { - return [ - 'category' => 'billing-alert', - 'title' => __t('billing_alert_reached_short'), - 'description' => __t('billing_alert_reached_short_note'), - 'action' => [ - 'type' => 'route', - 'params' => [ - 'route' => __t('billing'), - 'button' => __t('show_billing'), - ], - ], - ]; - } -} diff --git a/src/Domain/Subscriptions/Notifications/BonusCreditAddedNotification.php b/src/Domain/Subscriptions/Notifications/BonusCreditAddedNotification.php deleted file mode 100644 index cccb39aa..00000000 --- a/src/Domain/Subscriptions/Notifications/BonusCreditAddedNotification.php +++ /dev/null @@ -1,41 +0,0 @@ - 'gift', - 'title' => __t('you_received_bonus', ['bonus' => $this->bonus]), - 'description' => __t('you_received_bonus_note', ['bonus' => $this->bonus]), - ]; - } -} diff --git a/src/Domain/Subscriptions/Notifications/ChargeFromCreditCardFailedAgainNotification.php b/src/Domain/Subscriptions/Notifications/ChargeFromCreditCardFailedAgainNotification.php deleted file mode 100644 index 7a09b0b9..00000000 --- a/src/Domain/Subscriptions/Notifications/ChargeFromCreditCardFailedAgainNotification.php +++ /dev/null @@ -1,26 +0,0 @@ -subject(__t('charge_from_card_failed_again_subject')) - ->greeting(__t('hello')) - ->line(__t('charge_from_card_failed_again_line')) - ->action(__t('charge_from_card_failed_again_action'), url('/user/settings/billing')); - } -} diff --git a/src/Domain/Subscriptions/Notifications/ChargeFromCreditCardFailedNotification.php b/src/Domain/Subscriptions/Notifications/ChargeFromCreditCardFailedNotification.php deleted file mode 100644 index c5d51aed..00000000 --- a/src/Domain/Subscriptions/Notifications/ChargeFromCreditCardFailedNotification.php +++ /dev/null @@ -1,26 +0,0 @@ -subject(__t('charge_from_card_failed_subject')) - ->greeting(__t('hello')) - ->line(__t('charge_from_card_failed_line')) - ->action(__t('charge_from_card_failed_action'), url('/user/settings/billing')); - } -} diff --git a/src/Domain/Subscriptions/Notifications/ConfirmStripePaymentNotification.php b/src/Domain/Subscriptions/Notifications/ConfirmStripePaymentNotification.php deleted file mode 100644 index cf9dbab1..00000000 --- a/src/Domain/Subscriptions/Notifications/ConfirmStripePaymentNotification.php +++ /dev/null @@ -1,31 +0,0 @@ -subject(__t('confirm_payment')) - ->greeting(__t('confirm_payment_greeting', ['amount' => $this->payload['amount']])) - ->line(__t('confirm_payment_line')) - ->action(__t('confirm_payment_action'), $this->payload['url']); - } -} diff --git a/src/Domain/Subscriptions/Notifications/InsufficientBalanceNotification.php b/src/Domain/Subscriptions/Notifications/InsufficientBalanceNotification.php deleted file mode 100644 index 53027eb8..00000000 --- a/src/Domain/Subscriptions/Notifications/InsufficientBalanceNotification.php +++ /dev/null @@ -1,42 +0,0 @@ -subject(__t('withdrawal_failed_long')) - ->greeting(__t('hello')) - ->line(__t('withdrawal_failed_long_note')) - ->action(__t('fund_your_account'), url('/user/settings/billing')); - } - - public function toArray(): array - { - return [ - 'category' => 'insufficient-balance', - 'title' => __t('withdrawal_failed_short'), - 'description' => __t('withdrawal_failed_short_note'), - 'action' => [ - 'type' => 'route', - 'params' => [ - 'route' => __t('billing'), - 'button' => __t('show_billing'), - ], - ], - ]; - } -} diff --git a/src/Domain/Subscriptions/Notifications/SubscriptionWasCreatedNotification.php b/src/Domain/Subscriptions/Notifications/SubscriptionWasCreatedNotification.php deleted file mode 100644 index 812893a0..00000000 --- a/src/Domain/Subscriptions/Notifications/SubscriptionWasCreatedNotification.php +++ /dev/null @@ -1,48 +0,0 @@ -subject(__t('subscription_created_long', ['plan' => $this->subscription->plan->name])) - ->greeting(__t('hello')) - ->line(__t('subscription_created_long_note', ['plan' => $this->subscription->plan->name])) - ->action(__t('go_to_subscription'), url('/user/settings/billing')); - } - - public function toArray(): array - { - return [ - 'category' => 'subscription-created', - 'title' => __t('subscription_created_short'), - 'description' => __t('subscription_created_short_note', ['plan' => $this->subscription->plan->name]), - 'action' => [ - 'type' => 'route', - 'params' => [ - 'route' => __t('billing'), - 'button' => __t('show_billing'), - ], - ], - ]; - } -} diff --git a/src/Domain/Teams/Actions/CheckMaxTeamMembersLimitAction.php b/src/Domain/Teams/Actions/CheckMaxTeamMembersLimitAction.php deleted file mode 100644 index c34913bd..00000000 --- a/src/Domain/Teams/Actions/CheckMaxTeamMembersLimitAction.php +++ /dev/null @@ -1,34 +0,0 @@ -limitations->summary(); - - // Check unlimited option - if ((int) $limits['max_team_members']['total'] === -1) { - return true; - } - - // Get currently used member emails - $allowedEmails = $limits['max_team_members']['meta']['allowed_emails']; - - // Get new email invites from request - $invitationEmails = collect($newInvites) - ->pluck('email'); - - // Count total unique members - $totalMembers = $allowedEmails - ->merge($invitationEmails) - ->unique() - ->count(); - - // Check if there is more unique members than total max team members are allowed - return ! ($totalMembers > $limits['max_team_members']['total']); - } -} diff --git a/src/Domain/Teams/Actions/ClearActionInInvitationNotificationAction.php b/src/Domain/Teams/Actions/ClearActionInInvitationNotificationAction.php deleted file mode 100644 index 54308c4a..00000000 --- a/src/Domain/Teams/Actions/ClearActionInInvitationNotificationAction.php +++ /dev/null @@ -1,38 +0,0 @@ -where('notifiable_id', $user->id) - ->where('data', 'LIKE', "%{$invitation->id}%") - ->first(); - - if ($notification) { - // Get data - $data = json_decode($notification->data); - - // Clear action object - $data->action = null; - - // Update notification - DB::table('notifications') - ->where('notifiable_id', $user->id) - ->where('data', 'LIKE', "%{$invitation->id}%") - ->update([ - 'data' => json_encode($data), - ]); - } - } -} diff --git a/src/Domain/Teams/Actions/InviteMembersIntoTeamFolderAction.php b/src/Domain/Teams/Actions/InviteMembersIntoTeamFolderAction.php deleted file mode 100644 index c7564868..00000000 --- a/src/Domain/Teams/Actions/InviteMembersIntoTeamFolderAction.php +++ /dev/null @@ -1,44 +0,0 @@ -each(function ($member) use ($folder) { - // Create invitation - $invitation = TeamFolderInvitation::create([ - 'permission' => $member['permission'], - 'email' => $member['email'], - 'parent_id' => $folder->id, - 'inviter_id' => $folder->user_id, - ]); - - // Get user - $user = User::where('email', $member['email'])->first(); - - // Invite native user - if ($user) { - $user->notify(new InvitationIntoTeamFolder($folder, $invitation)); - } - - // Invite guest - if (! $user) { - Notification::route('mail', $member['email']) - ->notify(new InvitationIntoTeamFolder($folder, $invitation)); - } - }); - } -} diff --git a/src/Domain/Teams/Actions/SetTeamFolderPropertyForAllChildrenAction.php b/src/Domain/Teams/Actions/SetTeamFolderPropertyForAllChildrenAction.php deleted file mode 100644 index 61f19455..00000000 --- a/src/Domain/Teams/Actions/SetTeamFolderPropertyForAllChildrenAction.php +++ /dev/null @@ -1,22 +0,0 @@ -where('id', $folder->id) - ->get('id'); - - // Set all children as team_folder = true - DB::table('folders') - ->whereIn('id', Arr::flatten(filter_folders_ids($childrenFolderIds))) - ->update(['team_folder' => $isTeamFolder]); - } -} diff --git a/src/Domain/Teams/Actions/UpdateInvitationsAction.php b/src/Domain/Teams/Actions/UpdateInvitationsAction.php deleted file mode 100644 index 903ed6f3..00000000 --- a/src/Domain/Teams/Actions/UpdateInvitationsAction.php +++ /dev/null @@ -1,57 +0,0 @@ -teamInvitations() - ->pluck('email'); - - // Get newbies added by user in request - $newbies = collect($invitations) - ->filter( - fn ($invitation) => ! in_array($invitation['email'], $storedInvitations->toArray()) - ); - - // Get deleted invitations by user in request - $removed = $storedInvitations->diff( - collect($invitations)->pluck('email')->toArray() - ); - - // Invite team members - if ($newbies->isNotEmpty()) { - $this->inviteMembers->onQueue()->execute($newbies->toArray(), $folder); - } - - // Delete invite from team folder - if ($removed->isNotEmpty()) { - DB::table('team_folder_invitations') - ->where('parent_id', $folder->id) - ->whereIn('email', $removed) - ->delete(); - } - - // Update privileges - collect($invitations) - ->each( - fn ($invitation) => - DB::table('team_folder_invitations') - ->where('parent_id', $folder->id) - ->where('email', $invitation['email']) - ->update([ - 'permission' => $invitation['permission'], - ]) - ); - } -} diff --git a/src/Domain/Teams/Actions/UpdateMembersAction.php b/src/Domain/Teams/Actions/UpdateMembersAction.php deleted file mode 100644 index 538a9abc..00000000 --- a/src/Domain/Teams/Actions/UpdateMembersAction.php +++ /dev/null @@ -1,40 +0,0 @@ -teamMembers() - ->pluck('user_id'); - - // Get deleted members from request - $deletedMembers = $existingMembers->diff( - collect($members)->pluck('id')->toArray() - ); - - // Remove team members from team folder - if ($deletedMembers->isNotEmpty()) { - DB::table('team_folder_members') - ->where('parent_id', $folder->id) - ->whereIn('user_id', $deletedMembers->toArray()) - ->delete(); - } - - // Update privileges - collect($members) - ->each( - fn ($member) => - DB::table('team_folder_members') - ->where('parent_id', $folder->id) - ->where('user_id', $member['id']) - ->update([ - 'permission' => $member['permission'], - ]) - ); - } -} diff --git a/src/Domain/Teams/Controllers/BrowseSharedWithMeController.php b/src/Domain/Teams/Controllers/BrowseSharedWithMeController.php deleted file mode 100644 index 50cad2c0..00000000 --- a/src/Domain/Teams/Controllers/BrowseSharedWithMeController.php +++ /dev/null @@ -1,56 +0,0 @@ -getLatestParent(); - - if (! Gate::any(['can-edit', 'can-view'], [$teamFolder, null])) { - abort(403, 'Access Denied'); - } - - $folders = Folder::with(['parent:id,name']) - ->where('parent_id', $id) - ->sortable() - ->get(); - - $files = File::with(['parent:id,name']) - ->where('parent_id', $id) - ->sortable() - ->get(); - } - - if (! $id) { - $sharedFolderIds = DB::table('team_folder_members') - ->where('user_id', Auth::id()) - ->whereIn('permission', ['can-edit', 'can-view']) - ->pluck('parent_id'); - - $folders = Folder::whereIn('id', $sharedFolderIds) - ->sortable() - ->get(); - } - - return [ - 'root' => $id ? new FolderResource(Folder::findOrFail($id)) : null, - 'folders' => new FolderCollection($folders), - 'files' => isset($files) ? new FilesCollection($files) : new FilesCollection([]), - 'teamFolder' => $id ? new FolderResource($teamFolder) : null, - ]; - } -} diff --git a/src/Domain/Teams/Controllers/ConvertFolderIntoTeamFolderController.php b/src/Domain/Teams/Controllers/ConvertFolderIntoTeamFolderController.php deleted file mode 100644 index 8a4e3cd7..00000000 --- a/src/Domain/Teams/Controllers/ConvertFolderIntoTeamFolderController.php +++ /dev/null @@ -1,59 +0,0 @@ -user->canInviteTeamMembers($request->input('invitations'))) { - return response([ - 'type' => 'error', - 'message' => 'You exceed your members limit.', - ], 401); - } - - // Update root team folder - $folder->update([ - 'team_folder' => 1, - 'parent_id' => null, - ]); - - // Mark all children folders as team folder - ($this->setTeamFolderPropertyForAllChildren)($folder, true); - - // Attach owner into members - TeamFolderMember::create([ - 'parent_id' => $folder->id, - 'user_id' => $folder->user_id, - 'permission' => 'owner', - ]); - - // Invite team members - ($this->inviteMembers)($request->input('invitations'), $folder); - - return response($folder, 201); - } -} diff --git a/src/Domain/Teams/Controllers/InvitationsController.php b/src/Domain/Teams/Controllers/InvitationsController.php deleted file mode 100644 index e8b4f183..00000000 --- a/src/Domain/Teams/Controllers/InvitationsController.php +++ /dev/null @@ -1,79 +0,0 @@ -status !== 'pending') { - abort(410); - } - - return new TeamInvitationResource($invitation); - } - - public function update( - TeamFolderInvitation $invitation, - ClearActionInInvitationNotificationAction $clearActionInInvitationNotification, - ): ResponseFactory|Response { - $user = User::where('email', $invitation->email) - ->first(); - - if ($user) { - if (is_demo_account()) { - return response('Done', 204); - } - - $invitation->accept(); - - // Store team member - TeamFolderMember::create([ - 'user_id' => $user->id, - 'parent_id' => $invitation->parent_id, - 'permission' => $invitation->permission, - ]); - - // Clear action in existing notification - $clearActionInInvitationNotification($user, $invitation); - } - - if (! $user) { - $invitation->update([ - 'status' => 'waiting-for-registration', - ]); - } - - return response('Done', 204); - } - - public function destroy( - TeamFolderInvitation $invitation, - ClearActionInInvitationNotificationAction $clearActionInInvitationNotification, - ): ResponseFactory|Response { - $invitation->reject(); - - // Get user from invitation - $user = User::where('email', $invitation->email) - ->first(); - - // Clear action in existing notification - if ($user) { - if (is_demo_account()) { - return response('Done', 204); - } - - $clearActionInInvitationNotification($user, $invitation); - } - - return response('Done', 204); - } -} diff --git a/src/Domain/Teams/Controllers/LeaveTeamFolderController.php b/src/Domain/Teams/Controllers/LeaveTeamFolderController.php deleted file mode 100644 index c754d8fe..00000000 --- a/src/Domain/Teams/Controllers/LeaveTeamFolderController.php +++ /dev/null @@ -1,34 +0,0 @@ -where('parent_id', $folder->id) - ->where('user_id', auth()->id()) - ->delete(); - - return response('Done.', 204); - } -} diff --git a/src/Domain/Teams/Controllers/NavigationTreeController.php b/src/Domain/Teams/Controllers/NavigationTreeController.php deleted file mode 100644 index 453b59a4..00000000 --- a/src/Domain/Teams/Controllers/NavigationTreeController.php +++ /dev/null @@ -1,31 +0,0 @@ -getLatestParent(); - - if (! Gate::any(['can-edit', 'can-view'], [$teamFolder, null])) { - abort(403, 'Access Denied'); - } - - $folders = Folder::with('folders:id,parent_id,id,name,team_folder') - ->where('parent_id', $teamFolder->id) - ->sortable() - ->get(['id', 'parent_id', 'id', 'name', 'team_folder']); - - return [ - [ - 'name' => $teamFolder->name, - 'folders' => $folders, - 'isMovable' => true, - 'isOpen' => true, - ], - ]; - } -} diff --git a/src/Domain/Teams/Controllers/TeamFoldersController.php b/src/Domain/Teams/Controllers/TeamFoldersController.php deleted file mode 100644 index cc3f20f0..00000000 --- a/src/Domain/Teams/Controllers/TeamFoldersController.php +++ /dev/null @@ -1,170 +0,0 @@ -where('team_folder', true) - ->sortable() - ->get(); - - $files = File::where('parent_id', $id) - ->sortable() - ->get(); - } - - if (! $id) { - $folders = Folder::where('parent_id', null) - ->where('team_folder', true) - ->where('user_id', Auth::id()) - ->sortable() - ->get(); - } - - // Collect folders and files to single array - return [ - 'folders' => new FolderCollection($folders), - 'files' => isset($files) ? new FilesCollection($files) : new FilesCollection([]), - 'root' => $id ? new FolderResource(Folder::findOrFail($id)) : null, - 'teamFolder' => $id ? new FolderResource(Folder::findOrFail($id)->getLatestParent()) : null, - ]; - } - - public function store( - CreateTeamFolderRequest $request, - ): ResponseFactory | Response { - // Abort in demo mode - abort_if(is_demo_account(), 201, 'Done.'); - - $data = CreateTeamFolderData::fromRequest($request); - - // Check if user can create team folder - if (! $request->user()->canCreateTeamFolder()) { - return response([ - 'type' => 'error', - 'message' => 'This user action is not allowed.', - ], 401); - } - - // Check if user didn't exceed max team members limit - if (! $request->user()->canInviteTeamMembers($data->invitations)) { - return response([ - 'type' => 'error', - 'message' => 'You exceed your members limit.', - ], 401); - } - - // Create folder - $folder = Folder::create([ - 'user_id' => $request->user()->id, - 'name' => $data->name, - 'team_folder' => 1, - ]); - - // Attach owner into members - TeamFolderMember::create([ - 'parent_id' => $folder->id, - 'user_id' => $request->user()->id, - 'permission' => 'owner', - ]); - - // Invite team members - $this->inviteMembers->onQueue()->execute($data->invitations, $folder); - - return response(new FolderResource($folder), 201); - } - - public function update( - UpdateTeamFolderMembersRequest $request, - Folder $folder, - UpdateInvitationsAction $updateInvitations, - UpdateMembersAction $updateMembers, - ): ResponseFactory | Response { - // Abort in demo mode - if (is_demo_account()) { - return response(new FolderResource($folder), 201); - } - - // Authorize request - $this->authorize('owner', $folder); - - // Check if user didn't exceed max team members limit - if (! $request->user()->canInviteTeamMembers($request->input('invitations'))) { - return response([ - 'type' => 'error', - 'message' => 'You exceed your members limit.', - ], 401); - } - - $updateInvitations( - $folder, - $request->input('invitations') - ); - - $updateMembers( - $folder, - $request->input('members') - ); - - return response(new FolderResource($folder), 201); - } - - public function destroy(Folder $folder): ResponseFactory | Response - { - // Abort in demo mode - if (is_demo_account()) { - return response('Done.', 201); - } - - $this->authorize('owner', $folder); - - // Delete existing invitations - DB::table('team_folder_invitations') - ->where('parent_id', $folder->id) - ->delete(); - - // Delete attached members from folder - DB::table('team_folder_members') - ->where('parent_id', $folder->id) - ->delete(); - - ($this->setTeamFolderPropertyForAllChildren)($folder, false); - - $folder->update([ - 'team_folder' => 0, - ]); - - return response('Done.', 204); - } -} diff --git a/src/Domain/Teams/DTO/CreateTeamFolderData.php b/src/Domain/Teams/DTO/CreateTeamFolderData.php deleted file mode 100644 index c3f30547..00000000 --- a/src/Domain/Teams/DTO/CreateTeamFolderData.php +++ /dev/null @@ -1,18 +0,0 @@ - $request->input('name'), - 'invitations' => $request->input('invitations'), - ]); - } -} diff --git a/src/Domain/Teams/Models/TeamFolderInvitation.php b/src/Domain/Teams/Models/TeamFolderInvitation.php deleted file mode 100644 index f5a4c791..00000000 --- a/src/Domain/Teams/Models/TeamFolderInvitation.php +++ /dev/null @@ -1,67 +0,0 @@ - 'string', - ]; - - protected $guarded = ['id']; - - public $incrementing = false; - - protected $keyType = 'string'; - - public function accept() - { - $this->update([ - 'status' => 'accepted', - ]); - } - - public function reject() - { - $this->update([ - 'status' => 'rejected', - ]); - } - - protected static function newFactory(): TeamFolderInvitationFactory - { - return TeamFolderInvitationFactory::new(); - } - - public function inviter(): HasOne - { - return $this->hasOne(User::class, 'id', 'inviter_id'); - } - - protected static function boot() - { - parent::boot(); - - static::creating(function ($invitation) { - $invitation->id = Str::uuid(); - $invitation->color = config('vuefilemanager.colors')[rand(0, 4)]; - }); - } -} diff --git a/src/Domain/Teams/Models/TeamFolderMember.php b/src/Domain/Teams/Models/TeamFolderMember.php deleted file mode 100644 index ad79413e..00000000 --- a/src/Domain/Teams/Models/TeamFolderMember.php +++ /dev/null @@ -1,31 +0,0 @@ -invitation->email); - - if ($user) { - return (new MailMessage) - ->subject(__t('team_invitation_notify_title', ['app' => $appTitle])) - ->greeting(__t('hello')) - ->line(__t('team_invitation_notify_desc')) - ->action(__t('join_into_team_folder'), url('/team-folder-invitation', ['id' => $this->invitation->id])) - ->salutation(__t('salutation') . ', ' . $appTitle); - } - - return (new MailMessage) - ->subject(__t('team_invitation_notify_title', ['app' => $appTitle])) - ->greeting(__t('hello')) - ->line(__t('team_invitation_notify_desc_without_account')) - ->action(__t('join_and_create_account'), url('/team-folder-invitation', ['id' => $this->invitation->id])) - ->salutation(__t('salutation') . ', ' . $appTitle); - } - - /** - * Get the array representation of the notification. - */ - public function toArray(mixed $notifiable): array - { - return [ - 'category' => 'team-invitation', - 'title' => __t('new_team_invitation'), - 'description' => __t('x_invite_to_join_team', ['name' => $this->invitation->inviter->settings->name, ]), - 'action' => [ - 'type' => 'invitation', - 'params' => [ - 'id' => $this->invitation->id, - ], - ], - ]; - } -} diff --git a/src/Domain/Teams/Requests/ConvertIntoTeamFolderRequest.php b/src/Domain/Teams/Requests/ConvertIntoTeamFolderRequest.php deleted file mode 100644 index edf12c3c..00000000 --- a/src/Domain/Teams/Requests/ConvertIntoTeamFolderRequest.php +++ /dev/null @@ -1,29 +0,0 @@ - 'required|array', - ]; - } -} diff --git a/src/Domain/Teams/Requests/CreateTeamFolderRequest.php b/src/Domain/Teams/Requests/CreateTeamFolderRequest.php deleted file mode 100644 index 9e7cf31b..00000000 --- a/src/Domain/Teams/Requests/CreateTeamFolderRequest.php +++ /dev/null @@ -1,30 +0,0 @@ - 'required|string', - 'invitations' => 'required|array', - ]; - } -} diff --git a/src/Domain/Teams/Requests/UpdateTeamFolderMembersRequest.php b/src/Domain/Teams/Requests/UpdateTeamFolderMembersRequest.php deleted file mode 100644 index 785638ae..00000000 --- a/src/Domain/Teams/Requests/UpdateTeamFolderMembersRequest.php +++ /dev/null @@ -1,30 +0,0 @@ - 'present|array', - 'invitations' => 'present|array', - ]; - } -} diff --git a/src/Domain/Teams/Resources/TeamInvitationResource.php b/src/Domain/Teams/Resources/TeamInvitationResource.php deleted file mode 100644 index 3e5fd2c5..00000000 --- a/src/Domain/Teams/Resources/TeamInvitationResource.php +++ /dev/null @@ -1,41 +0,0 @@ - [ - 'id' => $this->id, - 'type' => 'invitation', - 'attributes' => [ - 'parent_id' => $this->parent_id, - 'email' => $this->email, - 'color' => $this->color, - 'status' => $this->status, - 'permission' => $this->permission, - 'isExistedUser' => User::where('email', $this->email)->exists(), - ], - 'relationships' => [ - $this->mergeWhen($this->inviter, fn () => [ - 'inviter' => [ - 'data' => [ - 'type' => 'user', - 'id' => $this->inviter->id, - 'attributes' => [ - 'name' => $this->inviter->settings->name, - 'avatar' => $this->inviter->settings->avatar, - 'color' => $this->inviter->settings->color, - ], - ], - ], - ]), - ], - ], - ]; - } -} diff --git a/src/Domain/Teams/Resources/TeamInvitationsCollection.php b/src/Domain/Teams/Resources/TeamInvitationsCollection.php deleted file mode 100644 index 102f15d2..00000000 --- a/src/Domain/Teams/Resources/TeamInvitationsCollection.php +++ /dev/null @@ -1,16 +0,0 @@ - $this->collection, - ]; - } -} diff --git a/src/Domain/Teams/Resources/TeamMemberResource.php b/src/Domain/Teams/Resources/TeamMemberResource.php deleted file mode 100644 index 5453e659..00000000 --- a/src/Domain/Teams/Resources/TeamMemberResource.php +++ /dev/null @@ -1,24 +0,0 @@ - [ - 'id' => $this->id, - 'type' => 'member', - 'attributes' => [ - 'email' => $this->email, - 'name' => $this->settings->name, - 'avatar' => $this->settings->avatar, - 'color' => $this->settings->color, - 'permission' => $this->pivot->permission, - ], - ], - ]; - } -} diff --git a/src/Domain/Teams/Resources/TeamMembersCollection.php b/src/Domain/Teams/Resources/TeamMembersCollection.php deleted file mode 100644 index c9a08084..00000000 --- a/src/Domain/Teams/Resources/TeamMembersCollection.php +++ /dev/null @@ -1,16 +0,0 @@ - $this->collection, - ]; - } -} diff --git a/src/Domain/Transactions/Controllers/GetAllTransactionsController.php b/src/Domain/Transactions/Controllers/GetAllTransactionsController.php deleted file mode 100644 index 1ba64c92..00000000 --- a/src/Domain/Transactions/Controllers/GetAllTransactionsController.php +++ /dev/null @@ -1,19 +0,0 @@ -sortable(['created_at' => 'desc']) - ->paginate(20); - - return new TransactionCollection($transactions); - } -} diff --git a/src/Domain/Transactions/Controllers/GetTransactionsController.php b/src/Domain/Transactions/Controllers/GetTransactionsController.php deleted file mode 100644 index ee017a6c..00000000 --- a/src/Domain/Transactions/Controllers/GetTransactionsController.php +++ /dev/null @@ -1,19 +0,0 @@ -transactions() - ->sortable(['created_at' => 'desc']) - ->paginate(15); - - return new TransactionCollection($transactions); - } -} diff --git a/src/Domain/Transactions/Controllers/GetUserTransactionsController.php b/src/Domain/Transactions/Controllers/GetUserTransactionsController.php deleted file mode 100644 index d8397b89..00000000 --- a/src/Domain/Transactions/Controllers/GetUserTransactionsController.php +++ /dev/null @@ -1,19 +0,0 @@ -transactions() - ->sortable(['created_at' => 'desc']) - ->paginate(20); - - return new TransactionCollection($transactions); - } -} diff --git a/src/Domain/Transactions/Resources/TransactionCollection.php b/src/Domain/Transactions/Resources/TransactionCollection.php deleted file mode 100644 index 2df6cb4e..00000000 --- a/src/Domain/Transactions/Resources/TransactionCollection.php +++ /dev/null @@ -1,22 +0,0 @@ - $this->collection, - ]; - } -} diff --git a/src/Domain/Transactions/Resources/TransactionResource.php b/src/Domain/Transactions/Resources/TransactionResource.php deleted file mode 100644 index 638a3729..00000000 --- a/src/Domain/Transactions/Resources/TransactionResource.php +++ /dev/null @@ -1,57 +0,0 @@ - [ - 'id' => $this->id, - 'type' => 'transactions', - 'attributes' => [ - 'type' => $this->type, - 'status' => $this->status, - 'note' => $this->note, - 'price' => format_currency($this->amount, $this->currency), - 'currency' => $this->currency, - 'amount' => $this->amount, - 'driver' => $this->driver, - 'reference' => $this->reference, - 'metadata' => $this->metadata - ? resolve(FormatUsageEstimatesAction::class)($this->currency, $this->metadata) - : null, - 'created_at' => format_date($this->created_at, 'd. M. Y'), - 'updated_at' => format_date($this->updated_at, 'd. M. Y'), - ], - 'relationships' => [ - $this->mergeWhen($this->user && $this->user->settings, fn () => [ - 'user' => [ - 'data' => [ - 'id' => $this->user->id, - 'type' => 'users', - 'attributes' => [ - 'avatar' => $this->user->settings->avatar, - 'first_name' => $this->user->settings->first_name, - 'last_name' => $this->user->settings->last_name, - 'name' => $this->user->settings->name, - 'color' => $this->user->settings->color, - 'email' => $this->user->email, - ], - ], - ], - ]), - ], - ], - ]; - } -} diff --git a/src/Domain/UploadRequest/Controllers/BrowseUploadRequestController.php b/src/Domain/UploadRequest/Controllers/BrowseUploadRequestController.php deleted file mode 100644 index fe7e39d6..00000000 --- a/src/Domain/UploadRequest/Controllers/BrowseUploadRequestController.php +++ /dev/null @@ -1,40 +0,0 @@ -id; - - $folders = Folder::with(['parent:id,name']) - ->where('parent_id', $rootId) - ->where('user_id', $uploadRequest->user_id) - ->sortable() - ->get(); - - // TODO: security check - $files = File::with(['parent:id,name']) - ->where('parent_id', $rootId) - ->where('user_id', $uploadRequest->user_id) - ->sortable() - ->get() - ->each(fn ($file) => $file->setUploadRequestPublicUrl($uploadRequest->id)); - - // Collect folders and files to single array - return [ - 'folders' => new FolderCollection($folders), - 'files' => new FilesCollection($files), - 'root' => new FolderResource(Folder::find($rootId)), - ]; - } -} diff --git a/src/Domain/UploadRequest/Controllers/CreateFolderController.php b/src/Domain/UploadRequest/Controllers/CreateFolderController.php deleted file mode 100644 index 3422b995..00000000 --- a/src/Domain/UploadRequest/Controllers/CreateFolderController.php +++ /dev/null @@ -1,40 +0,0 @@ -input('parent_id'), getChildrenFolderIds($uploadRequest->id))) { - return response('Access Denied', 403); - } - - // Create new folder - $folder = Folder::create([ - 'parent_id' => $request->input('parent_id'), - 'name' => $request->input('name'), - 'color' => $request->input('color') ?? null, - 'emoji' => $request->input('emoji') ?? null, - 'author' => 'visitor', - 'user_id' => $uploadRequest->user_id, - 'team_folder' => false, - ]); - - // Return new folder - return response(new FolderResource($folder), 201); - } -} diff --git a/src/Domain/UploadRequest/Controllers/CreateUploadRequestController.php b/src/Domain/UploadRequest/Controllers/CreateUploadRequestController.php deleted file mode 100644 index a30983ae..00000000 --- a/src/Domain/UploadRequest/Controllers/CreateUploadRequestController.php +++ /dev/null @@ -1,30 +0,0 @@ -uploadRequest()->create([ - 'folder_id' => $request->input('folder_id'), - 'email' => $request->input('email'), - 'notes' => $request->input('notes'), - 'name' => $request->input('name'), - ]); - - // If user type email, notify by email - if ($uploadRequest->email) { - Notification::route('mail', $uploadRequest->email) - ->notify(new UploadRequestNotification($uploadRequest)); - } - - return response(new UploadRequestResource($uploadRequest), 201); - } -} diff --git a/src/Domain/UploadRequest/Controllers/DeleteFileOrFolderController.php b/src/Domain/UploadRequest/Controllers/DeleteFileOrFolderController.php deleted file mode 100644 index d0c31222..00000000 --- a/src/Domain/UploadRequest/Controllers/DeleteFileOrFolderController.php +++ /dev/null @@ -1,71 +0,0 @@ -input('items') as $file) { - // Get file or folder item - $item = get_item($file['type'], $file['id']); - - // Delete folder - if ($file['type'] === 'folder') { - $this->destroyFolder($item); - } - - // Delete file - if ($file['type'] !== 'folder') { - $this->destroyFile($item); - } - } - - return response('Done', 204); - } - - private function destroyFile(File $file): void - { - // Delete file - Storage::delete("/files/$file->user_id/$file->basename"); - - // Delete thumbnail if exist - if ($file->type === 'image') { - getThumbnailFileList($file->basename) - ->each(fn ($thumbnail) => Storage::delete("files/$file->user_id/$thumbnail")); - } - - // Delete file permanently - $file->forceDelete(); - } - - private function destroyFolder(Folder $folder): void - { - // Get children files - $files = File::whereIn('parent_id', Arr::flatten([filter_folders_ids($folder->folders), $folder->id])) - ->get(); - - // Remove all children files - foreach ($files as $file) { - // Delete file - Storage::delete("/files/$file->user_id/$file->basename"); - - // Delete thumbnail if exist - if ($file->type === 'image') { - getThumbnailFileList($file->basename) - ->each(fn ($thumbnail) => Storage::delete("files/$file->user_id/$thumbnail")); - } - - // Delete file permanently - $file->forceDelete(); - } - - $folder->forceDelete(); - } -} diff --git a/src/Domain/UploadRequest/Controllers/FileAccess/GetFileFromUploadRequestController.php b/src/Domain/UploadRequest/Controllers/FileAccess/GetFileFromUploadRequestController.php deleted file mode 100644 index 855143f6..00000000 --- a/src/Domain/UploadRequest/Controllers/FileAccess/GetFileFromUploadRequestController.php +++ /dev/null @@ -1,41 +0,0 @@ -user_id) - ->where('basename', $filename) - ->firstOrFail(); - - // Store user download size - ($this->recordDownload)( - file_size: $file->filesize, - user_id: $uploadRequest->user_id, - ); - - // Finally, download file - return ($this->downloadFile)($file); - } -} diff --git a/src/Domain/UploadRequest/Controllers/FileAccess/GetThumbnailFromUploadRequestController.php b/src/Domain/UploadRequest/Controllers/FileAccess/GetThumbnailFromUploadRequestController.php deleted file mode 100644 index ca349724..00000000 --- a/src/Domain/UploadRequest/Controllers/FileAccess/GetThumbnailFromUploadRequestController.php +++ /dev/null @@ -1,43 +0,0 @@ -user_id) - ->where('basename', substr($filename, 3)) - ->firstOrFail(); - - // Store user download size - ($this->recordDownload)( - file_size: $file->filesize, - user_id: $uploadRequest->user_id, - ); - - // Finally, download thumbnail - return ($this->downloadThumbnail)($filename, $file); - } -} diff --git a/src/Domain/UploadRequest/Controllers/GetFolderTreeForUploadRequestController.php b/src/Domain/UploadRequest/Controllers/GetFolderTreeForUploadRequestController.php deleted file mode 100644 index c002baca..00000000 --- a/src/Domain/UploadRequest/Controllers/GetFolderTreeForUploadRequestController.php +++ /dev/null @@ -1,32 +0,0 @@ -whereParentId($uploadRequest->id) - ->whereUserId($uploadRequest->user_id) - ->sortable() - ->get(['id', 'parent_id', 'id', 'name']); - - return [ - [ - 'name' => __t('upload_request'), - 'location' => 'upload-request', - 'folders' => $folders, - 'isMovable' => true, - 'isOpen' => true, - ], - ]; - } -} diff --git a/src/Domain/UploadRequest/Controllers/GetUploadRequestController.php b/src/Domain/UploadRequest/Controllers/GetUploadRequestController.php deleted file mode 100644 index 5f8cb576..00000000 --- a/src/Domain/UploadRequest/Controllers/GetUploadRequestController.php +++ /dev/null @@ -1,13 +0,0 @@ -input('items') as $item) { - $item = get_item($item['type'], $item['id']); - - // Check privileges - if (! in_array($item['parent_id'], getChildrenFolderIds($uploadRequest->id))) { - return response('Access Denied', 403); - } - - $item->update(['parent_id' => $request->input('to_id') ?? $uploadRequest->id]); - } - - return response('Done.', 204); - } -} diff --git a/src/Domain/UploadRequest/Controllers/RenameFileOrFolderController.php b/src/Domain/UploadRequest/Controllers/RenameFileOrFolderController.php deleted file mode 100644 index 8ea77c3a..00000000 --- a/src/Domain/UploadRequest/Controllers/RenameFileOrFolderController.php +++ /dev/null @@ -1,44 +0,0 @@ -input('type'), $id); - - // Check privileges - if (! in_array($item->parent_id, getChildrenFolderIds($uploadRequest->id))) { - return response('Access Denied', 403); - } - - // If request contain icon or color, then change it - if ($request->input('type') === 'folder' && $request->hasAny(['emoji', 'color'])) { - ($this->updateFolderProperty)($request, $id); - } - - // Update item - $item->update(['name' => $request->input('name')]); - - if ($request->input('type') === 'folder') { - return new FolderResource($item); - } - - return new FileResource($item); - } -} diff --git a/src/Domain/UploadRequest/Controllers/SetUploadRequestAsFilledController.php b/src/Domain/UploadRequest/Controllers/SetUploadRequestAsFilledController.php deleted file mode 100644 index 505a3012..00000000 --- a/src/Domain/UploadRequest/Controllers/SetUploadRequestAsFilledController.php +++ /dev/null @@ -1,26 +0,0 @@ -update([ - 'status' => 'filled', - ]); - - // Send user notification - if ($uploadRequest->user->email !== 'howdy@hi5ve.digital') { - $uploadRequest->user->notify(new UploadRequestFulfilledNotification($uploadRequest)); - } - - return response(new UploadRequestResource($uploadRequest), 201); - } -} diff --git a/src/Domain/UploadRequest/Controllers/UploadFilesForUploadRequestController.php b/src/Domain/UploadRequest/Controllers/UploadFilesForUploadRequestController.php deleted file mode 100644 index 67df3b18..00000000 --- a/src/Domain/UploadRequest/Controllers/UploadFilesForUploadRequestController.php +++ /dev/null @@ -1,79 +0,0 @@ -id); - - // Create folder if not exist - if ($folder->doesntExist()) { - $this->createFolder($uploadRequest); - } - - // Set default parent_id for uploaded file - if (is_null($request->input('parent_id'))) { - $request->merge(['parent_id' => $uploadRequest->id]); - } - - // Store file chunks - $chunkPath = ($this->storeFileChunks)($request); - - // Proceed after last chunk - if ($request->boolean('is_last')) { - // Process file - $file = ($this->processFie)($request, $uploadRequest->user, $chunkPath); - - // Set public access url - $file->setUploadRequestPublicUrl($uploadRequest->id); - - // Set timestamp for auto filling - cache()->set("auto-filling.$uploadRequest->id", now()->toString()); - - return response(new FileResource($file), 201); - } - } - - /** - * Create root Upload Request folder - */ - private function createFolder(UploadRequest $uploadRequest): void - { - // Format timestamp - $timestamp = format_date($uploadRequest->created_at, 'd. M. Y'); - - // Create folder - DB::table('folders')->insert([ - 'id' => $uploadRequest->id, - 'parent_id' => $uploadRequest->folder_id ?? null, - 'user_id' => $uploadRequest->user_id, - 'name' => $uploadRequest->name ?? __t('upload_request_default_folder', ['timestamp' => $timestamp]), - 'created_at' => now(), - 'updated_at' => now(), - ]); - - // Update upload request status - $uploadRequest->update([ - 'status' => 'filling', - ]); - } -} diff --git a/src/Domain/UploadRequest/Middleware/ProtectUploadRequestRoutes.php b/src/Domain/UploadRequest/Middleware/ProtectUploadRequestRoutes.php deleted file mode 100644 index c75e8efd..00000000 --- a/src/Domain/UploadRequest/Middleware/ProtectUploadRequestRoutes.php +++ /dev/null @@ -1,24 +0,0 @@ -route()->parameter('uploadRequest'); - - // Check if upload request is active - if (! in_array($uploadRequest->status, ['active', 'filling'])) { - return response('Gone', 410); - } - - return $next($request); - } -} diff --git a/src/Domain/UploadRequest/Models/UploadRequest.php b/src/Domain/UploadRequest/Models/UploadRequest.php deleted file mode 100644 index 2bd7c4d1..00000000 --- a/src/Domain/UploadRequest/Models/UploadRequest.php +++ /dev/null @@ -1,63 +0,0 @@ - 'string', - ]; - - protected $guarded = ['id']; - - public $incrementing = false; - - protected $keyType = 'string'; - - protected static function newFactory(): UploadRequestFactory - { - return UploadRequestFactory::new(); - } - - public function user(): HasOne - { - return $this->hasOne(User::class, 'id', 'user_id'); - } - - public function folder(): HasOne - { - return $this->hasOne(Folder::class, 'id', 'id'); - } - - public function parent(): HasOne - { - return $this->hasOne(Folder::class, 'id', 'folder_id'); - } - - protected static function boot() - { - parent::boot(); - - static::creating(fn ($invitation) => $invitation->id = Str::uuid()); - } -} diff --git a/src/Domain/UploadRequest/Notifications/UploadRequestFulfilledNotification.php b/src/Domain/UploadRequest/Notifications/UploadRequestFulfilledNotification.php deleted file mode 100644 index cc7a1c4a..00000000 --- a/src/Domain/UploadRequest/Notifications/UploadRequestFulfilledNotification.php +++ /dev/null @@ -1,64 +0,0 @@ -subject(__t('file_request_filled_mail', ['name' => $this->uploadRequest->parent->name])) - ->greeting(__t('hello')) - ->line(__t('file_request_filled_mail_note')) - ->action(__t('show_files'), url("/platform/files/{$this->uploadRequest->id}")) - ->salutation(__t('thanks_salutation')); - } - - /** - * Get the array representation of the notification. - */ - public function toArray(mixed $notifiable): array - { - return [ - 'category' => 'file-request', - 'title' => __t('file_request_filled'), - 'description' => __t('file_request_filled_desc', ['name' => $this->uploadRequest->parent->name, ]), - 'action' => [ - 'type' => 'route', - 'params' => [ - 'route' => 'Files', - 'button' => __t('show_files'), - 'id' => $this->uploadRequest->id, - ], - ], - ]; - } -} diff --git a/src/Domain/UploadRequest/Notifications/UploadRequestNotification.php b/src/Domain/UploadRequest/Notifications/UploadRequestNotification.php deleted file mode 100644 index 614e2665..00000000 --- a/src/Domain/UploadRequest/Notifications/UploadRequestNotification.php +++ /dev/null @@ -1,68 +0,0 @@ -uploadRequest->notes - ? __t('file_request_optional_message', ['name' => $this->uploadRequest->user->settings->first_name, 'notes' => $this->uploadRequest->notes]) - : null; - - return (new MailMessage) - ->subject(__t('file_request_notify_title', ['name' => $this->uploadRequest->user->settings->first_name])) - ->greeting(__t('hello')) - ->line(__t('file_request_notify_description', ['name' => $this->uploadRequest->user->settings->first_name])) - ->line($message) - ->action(__t('upload_your_files'), url("/request/{$this->uploadRequest->id}/upload")) - ->salutation(__t('thanks_salutation')); - } - - /** - * Get the array representation of the notification. - * - * @param mixed $notifiable - * @return array - */ - public function toArray($notifiable) - { - return [ - ]; - } -} diff --git a/src/Domain/UploadRequest/Requests/StoreUploadRequest.php b/src/Domain/UploadRequest/Requests/StoreUploadRequest.php deleted file mode 100644 index 44c9c0b0..00000000 --- a/src/Domain/UploadRequest/Requests/StoreUploadRequest.php +++ /dev/null @@ -1,32 +0,0 @@ - 'sometimes|string|nullable', - 'notes' => 'sometimes|string|nullable', - 'folder_id' => 'sometimes|string', - 'name' => 'sometimes|string|nullable', - ]; - } -} diff --git a/src/Domain/UploadRequest/Resources/UploadRequestResource.php b/src/Domain/UploadRequest/Resources/UploadRequestResource.php deleted file mode 100644 index bcef79eb..00000000 --- a/src/Domain/UploadRequest/Resources/UploadRequestResource.php +++ /dev/null @@ -1,41 +0,0 @@ - [ - 'id' => $this->id, - 'type' => 'upload-request', - 'attributes' => [ - 'folder_id' => $this->folder_id, - 'status' => $this->status, - 'email' => $this->email, - 'notes' => $this->notes, - 'url' => url("/request/$this->id/upload"), - ], - 'relationships' => [ - $this->mergeWhen($this->folder, fn () => [ - 'folder' => new FolderResource($this->folder), - ]), - 'user' => [ - 'data' => [ - 'id' => $this->user->id, - 'type' => 'user', - 'attributes' => [ - 'name' => $this->user->settings->first_name, - 'color' => $this->user->settings->color, - 'avatar' => $this->user->settings->avatar, - ], - ], - ], - ], - ], - ]; - } -} diff --git a/src/Support/Listeners/SubscriptionEventSubscriber.php b/src/Support/Listeners/SubscriptionEventSubscriber.php deleted file mode 100644 index 53ef9cc0..00000000 --- a/src/Support/Listeners/SubscriptionEventSubscriber.php +++ /dev/null @@ -1,47 +0,0 @@ -subscription->user->limitations()->update([ - 'max_storage_amount' => $event->subscription->fixedFeature('max_storage_amount'), - 'max_team_members' => $event->subscription->fixedFeature('max_team_members'), - ]); - } - - public function handleSubscriptionWasUpdated($event) - { - $event->subscription->user->limitations()->update([ - 'max_storage_amount' => $event->subscription->fixedFeature('max_storage_amount'), - 'max_team_members' => $event->subscription->fixedFeature('max_team_members'), - ]); - } - - public function handleSubscriptionWasExpired($event) - { - // TODO: set default team members - $event->subscription->user->limitations()->update([ - 'max_storage_amount' => get_settings('default_max_storage_amount') ?? 5, - 'max_team_members' => 5, - ]); - } - - /** - * Register the listeners for the subscriber. - */ - public function subscribe(Dispatcher $events): array - { - return [ - SubscriptionWasCreated::class => 'handleSubscriptionWasCreated', - SubscriptionWasExpired::class => 'handleSubscriptionWasExpired', - SubscriptionWasUpdated::class => 'handleSubscriptionWasUpdated', - ]; - } -} diff --git a/src/Support/Scheduler/Actions/ExpireUnfilledUploadRequestAction.php b/src/Support/Scheduler/Actions/ExpireUnfilledUploadRequestAction.php deleted file mode 100644 index e86ed3c0..00000000 --- a/src/Support/Scheduler/Actions/ExpireUnfilledUploadRequestAction.php +++ /dev/null @@ -1,28 +0,0 @@ -cursor() - ->each(function ($uploadRequest) { - // Get timestamp of last upload if exist - $isLastUpload = cache()->has("auto-filling.$uploadRequest->id"); - - // Set as filled 3 hours after last upload - if ($isLastUpload && Carbon::parse(cache()->get("auto-filling.$uploadRequest->id"))->diffInHours(now()) >= 3) { - $uploadRequest->update(['status' => 'filled']); - } - - // If upload request exist more than 72 hours, then expire it - if (! $isLastUpload && $uploadRequest->created_at->diffInHours(now()) >= 72) { - $uploadRequest->update(['status' => 'expired']); - } - }); - } -} diff --git a/src/Support/Scheduler/Actions/ReportUsageAction.php b/src/Support/Scheduler/Actions/ReportUsageAction.php deleted file mode 100644 index 51d30486..00000000 --- a/src/Support/Scheduler/Actions/ReportUsageAction.php +++ /dev/null @@ -1,99 +0,0 @@ -where('status', 'active') - ->cursor() - ->each(function ($subscription) { - if ($subscription->plan->meteredFeatures()->where('key', 'bandwidth')->exists()) { - $this->recordBandwidth($subscription); - } - - if ($subscription->plan->meteredFeatures()->where('key', 'storage')->exists()) { - $this->recordStorageUsage($subscription); - } - - if ($subscription->plan->meteredFeatures()->where('key', 'flatFee')->exists()) { - $this->recordFlatFee($subscription); - } - - if ($subscription->plan->meteredFeatures()->where('key', 'member')->exists()) { - $this->recordMemberUsage($subscription); - } - }); - } - - private function recordStorageUsage(Subscription $subscription): void - { - // Sum all file size - $filesize = DB::table('files') - ->where('user_id', $subscription->user->id) - ->sum('filesize'); - - // We count storage size in GB, e.g. 0.150 is 150mb - $amount = $filesize / 1_000_000_000; - - // Record storage capacity usage - $subscription->recordUsage('storage', $amount); - } - - private function recordBandwidth(Subscription $subscription): void - { - // We count storage size in GB, e.g. 0.15 is 150mb - $record = $subscription - ->user - ->traffics() - ->whereDate('created_at', today()->subDay()) - ->first(); - - $amount = (($record->download ?? 0) + ($record->upload ?? 0)) / 1_000_000_000; - - // Record storage capacity usage - $subscription->recordUsage('bandwidth', $amount); - } - - private function recordFlatFee(Subscription $subscription): void - { - // Record flat fee - $subscription->recordUsage('flatFee', 1); - } - - // TODO: Refactor this function to get total used team members, same function here UserLimitation.php@getMaxTeamMembers - private function recordMemberUsage(Subscription $subscription): void - { - $userTeamFolderIds = DB::table('team_folder_members') - ->where('user_id', $subscription->user_id) - ->pluck('parent_id'); - - $memberIds = DB::table('team_folder_members') - ->where('user_id', '!=', $subscription->user_id) - ->whereIn('parent_id', $userTeamFolderIds) - ->pluck('user_id') - ->unique(); - - // Get member emails - $memberEmails = User::whereIn('id', $memberIds) - ->pluck('email'); - - // Get active invitation emails - $InvitationEmails = DB::table('team_folder_invitations') - ->where('status', 'pending') - ->where('inviter_id', $subscription->user_id) - ->pluck('email') - ->unique(); - - // Get allowed emails in the limit - $totalUsedEmails = $memberEmails->merge($InvitationEmails) - ->unique(); - - $subscription->recordUsage('member', $totalUsedEmails->count()); - } -} diff --git a/tests/App/Restrictions/FixedBillingRestrictionsTest.php b/tests/App/Restrictions/FixedBillingRestrictionsTest.php deleted file mode 100644 index a7f97cef..00000000 --- a/tests/App/Restrictions/FixedBillingRestrictionsTest.php +++ /dev/null @@ -1,225 +0,0 @@ - 'subscription_type', - ], [ - 'value' => 'fixed', - ]); - } - - /** - * @test - */ - public function it_can_upload() - { - $user = User::factory() - ->hasSettings() - ->create(); - - $this->assertEquals(true, $user->canUpload(9999999)); - } - - /** - * @test - */ - public function it_cant_upload_because_storage_limit_exceeded() - { - $user = User::factory() - ->hasSettings() - ->create(); - - File::factory() - ->create([ - 'user_id' => $user->id, - 'filesize' => 99999999, - ]); - - $this->assertEquals(false, $user->canUpload(999999999)); - } - - /** - * @test - */ - public function it_can_create_new_folder() - { - $user = User::factory() - ->hasSettings() - ->create(); - - $this - ->actingAs($user) - ->postJson('/api/create-folder', [ - 'name' => 'New Folder', - ]) - ->assertStatus(201); - - $this->assertDatabaseHas('folders', [ - 'name' => 'New Folder', - ]); - } - - /** - * @test - */ - public function it_cant_invite_team_members_into_team_folder_because_user_exceeded_members_limit() - { - $user = User::factory() - ->hasSettings() - ->hasFolders([ - 'team_folder' => true, - ]) - ->create(); - - TeamFolderMember::create([ - 'parent_id' => $user->folders[0]->id, - 'user_id' => $user->id, - 'permission' => 'owner', - ]); - - // Create team folder members - $members = User::factory() - ->count(5) - ->create() - ->each( - fn ($member) => TeamFolderMember::factory() - ->create([ - 'parent_id' => $user->folders[0]->id, - 'user_id' => $member->id, - ]) - ); - - // Try invite new members, it has to fail - $this - ->actingAs($user) - ->post('/api/teams/folders', [ - 'name' => 'Company Project', - 'invitations' => [ - [ - 'email' => 'test@doe.com', - 'permission' => 'can-edit', - ], - [ - 'email' => 'test2@doe.com', - 'permission' => 'can-edit', - ], - [ - 'email' => 'test3@doe.com', - 'permission' => 'can-edit', - ], - [ - 'email' => 'test4@doe.com', - 'permission' => 'can-edit', - ], - [ - 'email' => 'test5@doe.com', - 'permission' => 'can-edit', - ], - [ - 'email' => 'test6@doe.com', - 'permission' => 'can-edit', - ], - ], - ]) - ->assertStatus(401); - - // Invite existing member, it has to go through - $this - ->actingAs($user) - ->post('/api/teams/folders', [ - 'name' => 'Company Project', - 'invitations' => [ - [ - 'email' => $members[0]->email, - 'permission' => 'can-edit', - ], - ], - ]) - ->assertCreated(); - } - - /** - * @test - */ - public function it_can_get_private_file() - { - $user = User::factory() - ->hasSettings() - ->create(); - - $file = File::factory() - ->create([ - 'user_id' => $user->id, - 'basename' => 'fake-file.pdf', - 'name' => 'fake-file.pdf', - ]); - - // 404 but, ok, because there is not stored temporary file in test - $this - ->actingAs($user) - ->get("file/$file->name") - ->assertStatus(404); - } - - /** - * @test - */ - public function it_can_get_shared_file() - { - $user = User::factory() - ->hasSettings() - ->create(); - - $file = File::factory() - ->create([ - 'basename' => 'fake-file.pdf', - 'name' => 'fake-file.pdf', - ]); - - $share = Share::factory() - ->create([ - 'item_id' => $file->id, - 'user_id' => $user->id, - 'type' => 'file', - 'is_protected' => false, - ]); - - // 404 but, ok, because there is not stored temporary file in test - $this - ->get("file/$file->name/shared/$share->token") - ->assertStatus(404); - } - - /** - * @test - */ - public function it_can_get_share_page() - { - $user = User::factory() - ->hasSettings() - ->create(); - - $share = Share::factory() - ->create([ - 'user_id' => $user->id, - 'type' => 'folder', - 'is_protected' => false, - ]); - - $this->get("/share/$share->token") - ->assertRedirect("/share/$share->token/files/$share->item_id"); - } -} diff --git a/tests/App/Restrictions/MeteredBillingRestrictionsTest.php b/tests/App/Restrictions/MeteredBillingRestrictionsTest.php deleted file mode 100644 index 76a44444..00000000 --- a/tests/App/Restrictions/MeteredBillingRestrictionsTest.php +++ /dev/null @@ -1,240 +0,0 @@ - 'subscription_type', - ], [ - 'value' => 'metered', - ]); - } - - /** - * @test - */ - public function it_can_upload() - { - $user = User::factory() - ->hasFailedpayments(2) - ->create(); - - $this->assertEquals(true, $user->canUpload()); - } - - /** - * @test - */ - public function it_cant_upload_because_user_has_3_failed_payments() - { - $user = User::factory() - ->hasFailedpayments(3) - ->create(); - - $this->assertEquals(false, $user->canUpload()); - } - - /** - * @test - */ - public function it_can_create_new_folder() - { - $user = User::factory() - ->hasSettings() - ->create(); - - // Create basic folder - $this - ->actingAs($user) - ->postJson('/api/create-folder', [ - 'name' => 'New Folder', - ]) - ->assertStatus(201); - - // Create team folder - $this - ->actingAs($user) - ->postJson('/api/teams/folders', [ - 'name' => 'New Team Folder', - 'invitations' => [ - [ - 'email' => 'john@doe.com', - 'permission' => 'can-edit', - 'type' => 'invitation', - ], - ], - ]) - ->assertStatus(201); - - $this->assertDatabaseCount('folders', 2); - } - - /** - * @test - */ - public function it_cant_create_new_folder_because_user_has_3_failed_payments() - { - $user = User::factory() - ->hasFailedpayments(3) - ->create(); - - // Create basic folder - $this - ->actingAs($user) - ->postJson('/api/create-folder', [ - 'name' => 'New Folder', - ]) - ->assertStatus(401); - - // Create team folder - $this - ->actingAs($user) - ->postJson('/api/teams/folders', [ - 'name' => 'New Folder', - 'invitations' => [ - [ - 'email' => 'john@doe.com', - 'permission' => 'can-edit', - 'type' => 'invitation', - ], - ], - ]) - ->assertStatus(401); - - $this->assertDatabaseCount('folders', 0); - } - - /** - * @test - */ - public function it_cant_get_private_file_because_user_has_3_failed_payments() - { - $user = User::factory() - ->hasFailedpayments(3) - ->create(); - - $file = File::factory() - ->create([ - 'user_id' => $user->id, - 'basename' => 'fake-file.pdf', - 'name' => 'fake-file.pdf', - ]); - - $this - ->actingAs($user) - ->get("file/$file->name") - ->assertStatus(401); - } - - /** - * @test - */ - public function it_can_get_private_file() - { - $user = User::factory() - ->hasSettings() - ->create(); - - $file = File::factory() - ->create([ - 'user_id' => $user->id, - 'basename' => 'fake-file.pdf', - 'name' => 'fake-file.pdf', - ]); - - // 404 but, ok, because there is not stored temporary file in test - $this - ->actingAs($user) - ->get("file/$file->name") - ->assertStatus(404); - } - - /** - * @test - */ - public function it_cant_get_shared_file_because_user_has_3_failed_payments() - { - $user = User::factory() - ->hasFailedpayments(3) - ->create(); - - $file = File::factory() - ->create([ - 'user_id' => $user->id, - 'basename' => 'fake-file.pdf', - 'name' => 'fake-file.pdf', - ]); - - $share = Share::factory() - ->create([ - 'item_id' => $file->id, - 'user_id' => $user->id, - 'type' => 'file', - 'is_protected' => false, - ]); - - $this - ->get("file/$file->name/shared/$share->token") - ->assertStatus(401); - } - - /** - * @test - */ - public function it_can_get_shared_file() - { - $user = User::factory() - ->hasSettings() - ->create(); - - $file = File::factory() - ->create([ - 'user_id' => $user->id, - 'basename' => 'fake-file.pdf', - 'name' => 'fake-file.pdf', - ]); - - $share = Share::factory() - ->create([ - 'item_id' => $file->id, - 'user_id' => $user->id, - 'type' => 'file', - 'is_protected' => false, - ]); - - // 404 but, ok, because there is not stored temporary file in test - $this - ->get("file/$file->name/shared/$share->token") - ->assertStatus(404); - } - - /** - * @test - */ - public function it_cant_get_share_page() - { - $user = User::factory() - ->hasFailedpayments(3) - ->create(); - - $share = Share::factory() - ->create([ - 'user_id' => $user->id, - 'type' => 'folder', - 'is_protected' => false, - ]); - - $this->get("/share/$share->token") - ->assertRedirect('/temporary-unavailable'); - } -} diff --git a/tests/App/Socialite/SocialiteTest.php b/tests/App/Socialite/SocialiteTest.php deleted file mode 100644 index c91e2a0d..00000000 --- a/tests/App/Socialite/SocialiteTest.php +++ /dev/null @@ -1,88 +0,0 @@ -get('api/socialite/google/redirect'); - - $this->assertStringContainsString('accounts.google.com/o/oauth2/auth', $response['url']); - } - - /** - * @test - */ - public function socialite_execute_provider_callback() - { - // Create fake image - $fakeImage = UploadedFile::fake() - ->image('fake-avatar.jpg'); - - Http::fake([ - 'https://vuefilemanager.com/avatar.jpg' => Http::response($fakeImage->getContent()), - ]); - - // Create fake user - $socialiteUser = Mockery::mock(\Laravel\Socialite\Two\User::class); - $socialiteUser - ->shouldReceive('getId') - ->andReturn('fake_id') - ->shouldReceive('getEmail') - ->andReturn('howdy@hi5ve.digital') - ->shouldReceive('getName') - ->andReturn('Jane Doe') - ->shouldReceive('getAvatar') - ->andReturn('https://vuefilemanager.com/avatar.jpg'); - - // Mock user with FB provider - $provider = $this->createMock(FacebookProvider::class); - $provider->expects($this->any()) - ->method('user') - ->willReturn($socialiteUser); - - // Mock socialite - $stub = $this->createMock(Socialite::class); - - $stub->expects($this->any()) - ->method('driver') - ->willReturn($provider); - - // Replace Socialite Instance with mock - $this->app->instance(Socialite::class, $stub); - - $this->getJson('/socialite/facebook/callback') - ->assertRedirect(); - - $this - ->assertDatabaseHas('users', [ - 'email' => 'howdy@hi5ve.digital', - 'oauth_provider' => 'facebook', - 'password' => null, - ]) - ->assertDatabaseHas('user_settings', [ - 'first_name' => 'Jane', - 'last_name' => 'Doe', - ]); - - $user = User::first(); - - collect(config('vuefilemanager.avatar_sizes')) - ->each( - fn ($size) => Storage::disk('local') - ->assertExists("avatars/{$size['name']}-{$user->settings->getRawOriginal('avatar')}") - ); - } -} diff --git a/tests/App/Users/UserSubscriptionTest.php b/tests/App/Users/UserSubscriptionTest.php deleted file mode 100644 index f98b8b31..00000000 --- a/tests/App/Users/UserSubscriptionTest.php +++ /dev/null @@ -1,163 +0,0 @@ -has(PlanFixedFeature::factory() - ->count(2) - ->sequence( - [ - 'key' => 'max_storage_amount', - 'value' => 200, - ], - [ - 'key' => 'max_team_members', - 'value' => 20, - ], - ), 'fixedFeatures') - ->create(); - - $user = User::factory() - ->hasSubscription([ - 'plan_id' => $plan->id, - ]) - ->create(); - - SubscriptionWasCreated::dispatch($user->subscription); - - $this->assertDatabaseHas('user_limitations', [ - 'max_storage_amount' => 200, - 'max_team_members' => 20, - ]); - } - - /** - * @test - */ - public function it_set_user_limitations_for_updated_subscription() - { - $plan = Plan::factory() - ->has(PlanFixedFeature::factory() - ->count(2) - ->sequence( - [ - 'key' => 'max_storage_amount', - 'value' => 200, - ], - [ - 'key' => 'max_team_members', - 'value' => 20, - ], - ), 'fixedFeatures') - ->create(); - - $user = User::factory() - ->hasSubscription([ - 'plan_id' => $plan->id, - ]) - ->create(); - - SubscriptionWasUpdated::dispatch($user->subscription); - - $this->assertDatabaseHas('user_limitations', [ - 'max_storage_amount' => 200, - 'max_team_members' => 20, - ]); - } - - /** - * @test - */ - public function it_set_user_limitations_for_expired_subscription() - { - $user = User::factory() - ->hasSubscription() - ->create(); - - $user->limitations()->update([ - 'max_storage_amount' => 200, - 'max_team_members' => 20, - ]); - - SubscriptionWasExpired::dispatch($user->subscription); - - $this->assertDatabaseHas('user_limitations', [ - 'max_storage_amount' => 5, - 'max_team_members' => 5, - ]); - } - - /** - * @test - */ - public function it_format_price_estimates() - { - $usages = collect([ - [ - 'feature' => 'bandwidth', - 'amount' => 7.54696, - 'usage' => 2.6024, - ], [ - 'feature' => 'storage', - 'amount' => 0.47628, - 'usage' => 3.969, - ], [ - 'feature' => 'flatFee', - 'amount' => 2.49, - 'usage' => 1, - ], [ - 'feature' => 'member', - 'amount' => 0.20, - 'usage' => 2, - ], - ]); - - // Format usage estimates - $estimates = resolve(FormatUsageEstimatesAction::class)('USD', $usages) - ->toArray(); - - $expected = [ - 'bandwidth' => [ - 'feature' => 'bandwidth', - 'amount' => 7.54696, - 'cost' => '$7.55', - 'usage' => '2.60GB', - ], - 'storage' => [ - 'feature' => 'storage', - 'amount' => 0.47628, - 'cost' => '$0.48', - 'usage' => '3.97GB', - ], - 'flatFee' => [ - 'feature' => 'flatFee', - 'amount' => 2.49, - 'cost' => '$2.49', - 'usage' => '1 Pcs.', - ], - 'member' => [ - 'feature' => 'member', - 'amount' => 0.20, - 'cost' => '$0.20', - 'usage' => '2 Mem.', - ], - ]; - - $this->assertEquals($expected, $estimates); - } -} diff --git a/tests/Domain/Notifications/NotificationsTest.php b/tests/Domain/Notifications/NotificationsTest.php deleted file mode 100644 index aa352471..00000000 --- a/tests/Domain/Notifications/NotificationsTest.php +++ /dev/null @@ -1,133 +0,0 @@ -hasSettings() - ->create(); - - DB::table('notifications') - ->insert([ - 'id' => Str::uuid(), - 'type' => 'Domain\UploadRequest\Notifications\UploadRequestFulfilledNotification', - 'notifiable_type' => 'App\Users\Models\User', - 'notifiable_id' => $user->id, - 'data' => json_encode([ - 'category' => 'file-request', - 'title' => 'File Request Filled', - 'description' => "Your file request for 'Documents' folder was filled successfully.", - 'action' => [ - 'type' => 'route', - 'params' => [ - 'route' => 'Files', - 'button' => 'Show Files', - 'id' => Str::uuid(), - ], - ], - ]), - 'created_at' => now(), - 'updated_at' => now(), - ]); - - $this - ->actingAs($user) - ->getJson('/api/user/notifications') - ->assertJsonFragment([ - 'category' => 'file-request', - ]) - ->assertStatus(200); - } - - /** - * @test - */ - public function it_mark_as_read_notifications() - { - $user = User::factory() - ->hasSettings() - ->create(); - - DB::table('notifications') - ->insert([ - 'id' => Str::uuid(), - 'type' => 'Domain\UploadRequest\Notifications\UploadRequestFulfilledNotification', - 'notifiable_type' => 'App\Users\Models\User', - 'notifiable_id' => $user->id, - 'data' => json_encode([ - 'type' => 'file-request', - 'title' => 'File Request Filled', - 'description' => "Your file request for 'Documents' folder was filled successfully.", - 'action' => [ - 'type' => 'route', - 'params' => [ - 'route' => 'Files', - 'button' => 'Show Files', - 'id' => Str::uuid(), - ], - ], - ]), - 'created_at' => now(), - 'updated_at' => now(), - ]); - - $this - ->actingAs($user) - ->postJson('/api/user/notifications/read') - ->assertStatus(204); - - $this->assertDatabaseHas('notifications', [ - 'read_at' => now(), - ]); - } - - /** - * @test - */ - public function it_delete_all_notifications() - { - $user = User::factory() - ->hasSettings() - ->create(); - - DB::table('notifications') - ->insert([ - 'id' => Str::uuid(), - 'type' => 'Domain\UploadRequest\Notifications\UploadRequestFulfilledNotification', - 'notifiable_type' => 'App\Users\Models\User', - 'notifiable_id' => $user->id, - 'data' => json_encode([ - 'type' => 'file-request', - 'title' => 'File Request Filled', - 'description' => "Your file request for 'Documents' folder was filled successfully.", - 'action' => [ - 'type' => 'route', - 'params' => [ - 'route' => 'Files', - 'button' => 'Show Files', - 'id' => Str::uuid(), - ], - ], - ]), - 'created_at' => now(), - 'updated_at' => now(), - ]); - - $this - ->actingAs($user) - ->deleteJson('/api/user/notifications') - ->assertStatus(204); - - $this->assertDatabaseCount('notifications', 0); - } -} diff --git a/tests/Domain/Pages/AdminPagesTest.php b/tests/Domain/Pages/AdminPagesTest.php deleted file mode 100644 index e9558213..00000000 --- a/tests/Domain/Pages/AdminPagesTest.php +++ /dev/null @@ -1,73 +0,0 @@ -create(['role' => 'admin']); - - Sanctum::actingAs($admin); - - collect(['terms-of-service', 'privacy-policy', 'cookie-policy']) - ->each(function ($slug) { - $this->getJson('/api/admin/pages') - ->assertStatus(200) - ->assertJsonFragment([ - 'slug' => $slug, - ]); - }); - } - - /** - * @test - */ - public function it_get_page() - { - resolve(SeedDefaultPagesAction::class)(); - - $admin = User::factory() - ->create(['role' => 'admin']); - - $this - ->actingAs($admin) - ->getJson('/api/admin/pages/terms-of-service') - ->assertStatus(200) - ->assertJsonFragment([ - 'slug' => 'terms-of-service', - ]); - } - - /** - * @test - */ - public function it_update_page() - { - resolve(SeedDefaultPagesAction::class)(); - - $admin = User::factory() - ->create(['role' => 'admin']); - - $this - ->actingAs($admin) - ->patchJson('/api/admin/pages/terms-of-service', [ - 'name' => 'title', - 'value' => 'New Title', - ])->assertStatus(204); - - $this->assertDatabaseHas('pages', [ - 'title' => 'New Title', - ]); - } -} diff --git a/tests/Domain/Pages/PagesTest.php b/tests/Domain/Pages/PagesTest.php deleted file mode 100644 index 036fd00b..00000000 --- a/tests/Domain/Pages/PagesTest.php +++ /dev/null @@ -1,22 +0,0 @@ -getJson('/api/page/terms-of-service') - ->assertStatus(200) - ->assertJsonFragment([ - 'title' => 'Terms of Service', - ]); - } -} diff --git a/tests/Domain/Teams/TeamFileAccessTest.php b/tests/Domain/Teams/TeamFileAccessTest.php deleted file mode 100644 index bfbf087c..00000000 --- a/tests/Domain/Teams/TeamFileAccessTest.php +++ /dev/null @@ -1,112 +0,0 @@ -hasSettings() - ->create(); - - $folder = Folder::factory() - ->create([ - 'user_id' => $user->id, - ]); - - collect([0, 1]) - ->each(function ($index) use ($folder, $user) { - $file = UploadedFile::fake() - ->create("fake-file-$index.pdf", 1200, 'application/pdf'); - - $this - ->actingAs($user) - ->postJson('/api/upload', [ - 'name' => $file->name, - 'extension' => 'pdf', - 'file' => $file, - 'parent_id' => $folder->id, - 'path' => "/$file->name", - 'is_last' => 'true', - ])->assertStatus(201); - }); - - $member = User::factory() - ->hasSettings() - ->create(); - - // Attach user into members - TeamFolderMember::create([ - 'parent_id' => $folder->id, - 'user_id' => $member->id, - 'permission' => 'can-edit', - ]); - - $this - ->actingAs($member) - ->getJson("/api/zip?items=$folder->id|folder") - ->assertStatus(200) - ->assertHeader('content-type', 'application/x-zip'); - } - - /** - * @test - */ - public function team_member_download_files_as_zip() - { - $user = User::factory() - ->hasSettings() - ->create(); - - $folder = Folder::factory() - ->create([ - 'user_id' => $user->id, - ]); - - collect([0, 1]) - ->each(function ($index) use ($folder, $user) { - $file = UploadedFile::fake() - ->create("fake-file-$index.pdf", 1200, 'application/pdf'); - - $this - ->actingAs($user) - ->postJson('/api/upload', [ - 'name' => $file->name, - 'extension' => 'pdf', - 'file' => $file, - 'parent_id' => $folder->id, - 'path' => "/$file->name", - 'is_last' => 'true', - ])->assertStatus(201); - }); - - $member = User::factory() - ->hasSettings() - ->create(); - - // Attach user into members - TeamFolderMember::create([ - 'parent_id' => $folder->id, - 'user_id' => $member->id, - 'permission' => 'can-edit', - ]); - - $files = File::all(); - - $this - ->actingAs($member) - ->getJson("/api/zip?items={$files->first()->id}|file,{$files->last()->id}|file") - ->assertStatus(200) - ->assertHeader('content-type', 'application/x-zip'); - } -} diff --git a/tests/Domain/Teams/TeamManagementTest.php b/tests/Domain/Teams/TeamManagementTest.php deleted file mode 100644 index a55acfb3..00000000 --- a/tests/Domain/Teams/TeamManagementTest.php +++ /dev/null @@ -1,758 +0,0 @@ -hasSettings() - ->count(2) - ->create(); - - $invitation = TeamFolderInvitation::factory() - ->create([ - 'inviter_id' => $inviter->id, - 'parent_id' => Str::uuid(), - 'email' => $member->email, - 'status' => 'pending', - 'permission' => 'can-edit', - ]); - - $this->getJson("/api/teams/invitations/{$invitation->id}") - ->assertOk() - ->assertJsonFragment([ - 'name' => $inviter->settings->name, - ]); - } - - /** - * @test - */ - public function it_accept_team_folder_invite_as_registered_user() - { - $member = User::factory() - ->create([ - 'email' => 'john@internal.com', - ]); - - $folder = Folder::factory() - ->create(); - - $invitation = TeamFolderInvitation::factory() - ->create([ - 'parent_id' => $folder->id, - 'email' => $member->email, - 'status' => 'pending', - 'permission' => 'can-view', - ]); - - DB::table('notifications') - ->insert([ - 'id' => Str::uuid(), - 'type' => 'Domain\UploadRequest\Notifications\UploadRequestFulfilledNotification', - 'notifiable_type' => 'App\Users\Models\User', - 'notifiable_id' => $member->id, - 'data' => json_encode([ - 'type' => 'team-invitation', - 'title' => 'New Team Invitation', - 'description' => 'Jane Doe invite you to join into Team Folder..', - 'action' => [ - 'type' => 'invitation', - 'params' => [ - 'type' => 'invitation', - 'params' => [ - 'id' => $invitation->id, - ], - ], - ], - ]), - 'created_at' => now(), - 'updated_at' => now(), - ]); - - $this - ->actingAs($member) - ->putJson("/api/teams/invitations/{$invitation->id}") - ->assertNoContent(); - - // Get notification - $notification = json_decode(DB::table('notifications')->first()->data); - - // Check if action is null - $this->assertEquals(null, $notification->action); - - $this - ->assertDatabaseHas('team_folder_invitations', [ - 'parent_id' => $folder->id, - 'status' => 'accepted', - ]) - ->assertDatabaseHas('team_folder_members', [ - 'parent_id' => $folder->id, - 'user_id' => $member->id, - 'permission' => 'can-view', - ]); - } - - /** - * @test - */ - public function it_accept_team_folder_invite_as_guest_user() - { - $folder = Folder::factory() - ->create(); - - $invitation = TeamFolderInvitation::factory() - ->create([ - 'parent_id' => $folder->id, - 'email' => 'howdy@hi5ve.digital', - 'status' => 'pending', - 'permission' => 'can-edit', - ]); - - $this - ->putJson("/api/teams/invitations/{$invitation->id}") - ->assertNoContent(); - - $this - ->assertDatabaseHas('team_folder_invitations', [ - 'parent_id' => $folder->id, - 'status' => 'waiting-for-registration', - ]) - ->assertDatabaseMissing('team_folder_members', [ - 'parent_id' => $folder->id, - 'permission' => 'can-edit', - ]); - } - - /** - * @test - */ - public function it_apply_accepted_invitation_after_user_registration() - { - $invitation = TeamFolderInvitation::factory() - ->create([ - 'email' => 'john@doe.com', - 'status' => 'waiting-for-registration', - ]); - - $this->postJson('api/register', [ - 'email' => 'john@doe.com', - 'password' => 'SecretPassword', - 'password_confirmation' => 'SecretPassword', - 'name' => 'John Doe', - ])->assertStatus(201); - - $this - ->assertDatabaseHas('team_folder_invitations', [ - 'parent_id' => $invitation->parent_id, - 'status' => 'accepted', - ]) - ->assertDatabaseHas('team_folder_members', [ - 'parent_id' => $invitation->parent_id, - 'user_id' => User::first()->id, - 'permission' => $invitation->permission, - ]); - } - - /** - * @test - */ - public function it_get_used_team_folder_invite() - { - $invitation = TeamFolderInvitation::factory() - ->create(['status' => 'accepted']); - - $this - ->getJson("/api/teams/invitations/{$invitation->id}") - ->assertStatus(410); - } - - /** - * @test - */ - public function it_reject_team_folder_invite() - { - $member = User::factory() - ->create([ - 'email' => 'john@internal.com', - ]); - - $folder = Folder::factory() - ->create(); - - $invitation = TeamFolderInvitation::factory() - ->create([ - 'parent_id' => $folder->id, - 'email' => $member->email, - 'status' => 'pending', - 'permission' => 'can-edit', - ]); - - DB::table('notifications') - ->insert([ - 'id' => Str::uuid(), - 'type' => 'Domain\UploadRequest\Notifications\UploadRequestFulfilledNotification', - 'notifiable_type' => 'App\Users\Models\User', - 'notifiable_id' => $member->id, - 'data' => json_encode([ - 'type' => 'team-invitation', - 'title' => 'New Team Invitation', - 'description' => 'Jane Doe invite you to join into Team Folder..', - 'action' => [ - 'type' => 'invitation', - 'params' => [ - 'type' => 'invitation', - 'params' => [ - 'id' => $invitation->id, - ], - ], - ], - ]), - 'created_at' => now(), - 'updated_at' => now(), - ]); - - $this - ->actingAs($member) - ->deleteJson("/api/teams/invitations/{$invitation->id}") - ->assertNoContent(); - - // Get notification - $notification = json_decode(DB::table('notifications')->first()->data); - - // Check if action is null - $this->assertEquals(null, $notification->action); - - $this - ->assertDatabaseHas('team_folder_invitations', [ - 'parent_id' => $folder->id, - 'status' => 'rejected', - ]) - ->assertDatabaseMissing('team_folder_members', [ - 'parent_id' => $folder->id, - 'user_id' => $member->id, - ]); - } - - /** - * @test - */ - public function it_invite_member_into_team_folder() - { - [$user, $member_1, $member_2] = User::factory() - ->hasSettings() - ->count(3) - ->create(); - - $folder = Folder::factory() - ->create([ - 'user_id' => $user->id, - 'team_folder' => 1, - ]); - - TeamFolderInvitation::factory() - ->create([ - 'parent_id' => $folder->id, - 'status' => 'pending', - 'permission' => 'can-edit', - 'email' => 'existing@member.com', - ]); - - DB::table('team_folder_members') - ->insert([ - [ - 'parent_id' => $folder->id, - 'user_id' => $member_1->id, - 'permission' => 'can-edit', - ], - [ - 'parent_id' => $folder->id, - 'user_id' => $member_2->id, - 'permission' => 'can-edit', - ], - ]); - - $this - ->actingAs($user) - ->patchJson("/api/teams/folders/{$folder->id}", [ - 'members' => [ - [ - 'id' => $member_1->id, - 'permission' => 'can-edit', - ], - [ - 'id' => $member_2->id, - 'permission' => 'can-edit', - ], - ], - 'invitations' => [ - [ - 'id' => null, - 'email' => 'existing@member.com', - 'permission' => 'can-edit', - ], - [ - 'id' => null, - 'email' => 'added@member.com', - 'permission' => 'can-view', - ], - ], - ]) - ->assertCreated(); - - $this - ->assertDatabaseCount('team_folder_members', 2) - ->assertDatabaseCount('team_folder_invitations', 2) - ->assertDatabaseHas('team_folder_invitations', [ - 'email' => 'added@member.com', - 'permission' => 'can-view', - ]); - - Notification::assertTimesSent(1, InvitationIntoTeamFolder::class); - } - - /** - * @test - */ - public function it_delete_invited_member_from_team_folder() - { - [$user, $member_1, $member_2] = User::factory() - ->hasSettings() - ->count(3) - ->create(); - - $folder = Folder::factory() - ->create([ - 'user_id' => $user->id, - 'team_folder' => 1, - ]); - - TeamFolderInvitation::factory() - ->create([ - 'parent_id' => $folder->id, - 'status' => 'pending', - 'permission' => 'can-edit', - 'email' => 'deleted@member.com', - ]); - - TeamFolderInvitation::factory() - ->create([ - 'parent_id' => $folder->id, - 'status' => 'pending', - 'permission' => 'can-edit', - 'email' => 'existing@member.com', - ]); - - DB::table('team_folder_members') - ->insert([ - [ - 'parent_id' => $folder->id, - 'user_id' => $member_1->id, - 'permission' => 'can-edit', - ], - [ - 'parent_id' => $folder->id, - 'user_id' => $member_2->id, - 'permission' => 'can-edit', - ], - ]); - - $this - ->actingAs($user) - ->patchJson("/api/teams/folders/{$folder->id}", [ - 'members' => [ - [ - 'id' => $member_1->id, - 'permission' => 'can-edit', - ], - [ - 'id' => $member_2->id, - 'permission' => 'can-view', - ], - ], - 'invitations' => [ - [ - 'id' => null, - 'email' => 'existing@member.com', - 'permission' => 'can-view', - ], - ], - ]) - ->assertCreated(); - - $this - ->assertDatabaseCount('team_folder_members', 2) - ->assertDatabaseCount('team_folder_invitations', 1) - ->assertDatabaseHas('team_folder_invitations', [ - 'email' => 'existing@member.com', - ]); - } - - /** - * @test - */ - public function it_remove_member_from_team_folder() - { - [$user, $member, $deletedMember] = User::factory() - ->hasSettings() - ->count(3) - ->create(); - - $folder = Folder::factory() - ->create([ - 'user_id' => $user->id, - 'team_folder' => 1, - ]); - - // Attach members to the team folder - DB::table('team_folder_members') - ->insert([ - [ - 'parent_id' => $folder->id, - 'user_id' => $member->id, - 'permission' => 'can-edit', - ], - [ - 'parent_id' => $folder->id, - 'user_id' => $deletedMember->id, - 'permission' => 'can-edit', - ], - ]); - - // Update team folder members - $this - ->actingAs($user) - ->patchJson("/api/teams/folders/{$folder->id}", [ - 'members' => [ - [ - 'id' => $member->id, - 'permission' => 'can-edit', - ], - ], - 'invitations' => [], - ]) - ->assertCreated(); - - $this - ->assertDatabaseCount('team_folder_members', 1) - ->assertDatabaseMissing('team_folder_members', [ - 'user_id' => $deletedMember->id, - ]); - } - - /** - * @test - */ - public function it_update_invited_member_permission_in_team_folder() - { - $user = User::factory() - ->hasSettings() - ->create(); - - $folder = Folder::factory() - ->create([ - 'user_id' => $user->id, - 'team_folder' => 1, - ]); - - TeamFolderInvitation::factory() - ->create([ - 'parent_id' => $folder->id, - 'status' => 'pending', - 'permission' => 'can-view', - 'email' => 'existing@member.com', - ]); - - $this - ->actingAs($user) - ->patchJson("/api/teams/folders/{$folder->id}", [ - 'members' => [], - 'invitations' => [ - [ - 'id' => null, - 'email' => 'existing@member.com', - 'permission' => 'can-edit', - ], - ], - ]) - ->assertCreated(); - - $this - ->assertDatabaseCount('team_folder_members', 0) - ->assertDatabaseCount('team_folder_invitations', 1) - ->assertDatabaseHas('team_folder_invitations', [ - 'email' => 'existing@member.com', - 'permission' => 'can-edit', - ]); - - Notification::assertTimesSent(0, InvitationIntoTeamFolder::class); - } - - /** - * @test - */ - public function it_update_member_permission_in_team_folder() - { - [$user, $member_1, $member_2] = User::factory() - ->hasSettings() - ->count(3) - ->create(); - - $folder = Folder::factory() - ->create([ - 'user_id' => $user->id, - 'team_folder' => 1, - ]); - - DB::table('team_folder_members') - ->insert([ - [ - 'parent_id' => $folder->id, - 'user_id' => $member_1->id, - 'permission' => 'can-edit', - ], - [ - 'parent_id' => $folder->id, - 'user_id' => $member_2->id, - 'permission' => 'can-edit', - ], - ]); - - $this - ->actingAs($user) - ->patchJson("/api/teams/folders/{$folder->id}", [ - 'members' => [ - [ - 'id' => $member_1->id, - 'permission' => 'can-edit', - ], - [ - 'id' => $member_2->id, - 'permission' => 'can-view', - ], - ], - 'invitations' => [], - ]) - ->assertCreated(); - - $this->assertDatabaseHas('team_folder_members', [ - 'user_id' => $member_2->id, - 'permission' => 'can-view', - ]); - } - - /** - * @test - */ - public function member_try_update_permission_in_team_folder() - { - [$user, $member_1, $member_2] = User::factory() - ->count(3) - ->create(); - - $folder = Folder::factory() - ->create([ - 'user_id' => $user->id, - 'team_folder' => 1, - ]); - - DB::table('team_folder_members') - ->insert([ - [ - 'parent_id' => $folder->id, - 'user_id' => $member_1->id, - 'permission' => 'can-edit', - ], - [ - 'parent_id' => $folder->id, - 'user_id' => $member_2->id, - 'permission' => 'can-edit', - ], - ]); - - $this - ->actingAs( - User::find($member_1->id) - ) - ->patchJson("/api/teams/folders/{$folder->id}", [ - 'members' => [ - [ - 'id' => $member_1->id, - 'permission' => 'can-edit', - ], - [ - 'id' => $member_2->id, - 'permission' => 'can-view', - ], - ], - 'invitations' => [], - ]) - ->assertForbidden(); - - $this->assertDatabaseHas('team_folder_members', [ - 'user_id' => $member_2->id, - 'permission' => 'can-edit', - ]); - } - - /** - * @test - */ - public function it_dissolve_team_folder() - { - [$user, $member_1, $member_2] = User::factory() - ->count(3) - ->create(); - - $folder = Folder::factory() - ->create([ - 'user_id' => $user->id, - 'team_folder' => 1, - ]); - - $folderWithin = Folder::factory() - ->create([ - 'parent_id' => $folder->id, - 'user_id' => $user->id, - 'team_folder' => 1, - ]); - - TeamFolderInvitation::factory() - ->create([ - 'parent_id' => $folder->id, - 'status' => 'pending', - 'permission' => 'can-edit', - ]); - - DB::table('team_folder_members') - ->insert([ - [ - 'parent_id' => $folder->id, - 'user_id' => $member_1->id, - 'permission' => 'can-edit', - ], - [ - 'parent_id' => $folder->id, - 'user_id' => $member_2->id, - 'permission' => 'can-edit', - ], - ]); - - $this - ->actingAs($user) - ->deleteJson("/api/teams/folders/{$folder->id}") - ->assertNoContent(); - - $this - ->assertDatabaseCount('team_folder_members', 0) - ->assertDatabaseCount('team_folder_invitations', 0) - ->assertDatabaseHas('folders', [ - 'id' => $folder->id, - 'team_folder' => 0, - ]) - ->assertDatabaseHas('folders', [ - 'id' => $folderWithin->id, - 'team_folder' => 0, - ]); - } - - /** - * @test - */ - public function it_leave_team_folder() - { - [$user, $member] = User::factory() - ->count(2) - ->create(); - - $folder = Folder::factory() - ->create([ - 'name' => 'Team Folder', - 'user_id' => $user->id, - 'team_folder' => 1, - ]); - - // add member to the team folder - DB::table('team_folder_members') - ->insert([ - [ - 'parent_id' => $folder->id, - 'user_id' => $member->id, - 'permission' => 'can-edit', - ], - ]); - - $this - ->actingAs($member) - ->deleteJson("/api/teams/folders/{$folder->id}/leave") - ->assertNoContent(); - - $this - ->assertDatabaseMissing('team_folder_members', [ - 'parent_id' => $folder->id, - 'user_id' => $member->id, - 'permission' => 'can-edit', - ]); - } - - /** - * @test - */ - public function member_try_dissolve_team_folder() - { - [$user, $member_1, $member_2] = User::factory() - ->count(3) - ->create(); - - $folder = Folder::factory() - ->create([ - 'user_id' => $user->id, - 'team_folder' => 1, - ]); - - TeamFolderInvitation::factory() - ->create([ - 'parent_id' => $folder->id, - 'status' => 'pending', - 'permission' => 'can-edit', - ]); - - DB::table('team_folder_members') - ->insert([ - [ - 'parent_id' => $folder->id, - 'user_id' => $member_1->id, - 'permission' => 'can-edit', - ], - [ - 'parent_id' => $folder->id, - 'user_id' => $member_2->id, - 'permission' => 'can-edit', - ], - ]); - - $this - ->actingAs( - User::find($member_1->id) - ) - ->deleteJson("/api/teams/folders/{$folder->id}") - ->assertForbidden(); - - $this - ->assertDatabaseCount('team_folder_members', 2) - ->assertDatabaseCount('team_folder_invitations', 1); - } -} diff --git a/tests/Domain/Teams/TeamsTest.php b/tests/Domain/Teams/TeamsTest.php deleted file mode 100644 index e1257852..00000000 --- a/tests/Domain/Teams/TeamsTest.php +++ /dev/null @@ -1,299 +0,0 @@ -create([ - 'team_folder' => 1, - ]); - - $level_1 = Folder::factory() - ->create([ - 'parent_id' => $teamFolder->id, - ]); - - $level_2 = Folder::factory() - ->create([ - 'parent_id' => $level_1->id, - ]); - - $this->assertEquals($teamFolder->id, $level_2->getLatestParent()->id); - $this->assertEquals($teamFolder->id, $teamFolder->getLatestParent()->id); - } - - /** - * @test - */ - public function it_create_team_folder() - { - User::factory() - ->create([ - 'email' => 'john@internal.com', - ]); - - $user = User::factory() - ->hasSettings() - ->create(); - - $this - ->actingAs($user) - ->post('/api/teams/folders', [ - 'name' => 'Company Project', - 'invitations' => [ - [ - 'email' => 'john@internal.com', - 'permission' => 'can-edit', - ], - [ - 'email' => 'jane@external.com', - 'permission' => 'can-view', - ], - ], - ]) - ->assertCreated() - ->assertJsonFragment([ - 'name' => 'Company Project', - ]); - - $this - ->assertDatabaseHas('folders', [ - 'user_id' => $user->id, - 'name' => 'Company Project', - 'team_folder' => 1, - ]) - ->assertDatabaseHas('team_folder_invitations', [ - 'email' => 'john@internal.com', - ]) - ->assertDatabaseHas('team_folder_invitations', [ - 'email' => 'jane@external.com', - ]); - - Notification::assertTimesSent(2, InvitationIntoTeamFolder::class); - } - - /** - * @test - */ - public function it_mark_newly_created_folder_as_team_folder() - { - $user = User::factory() - ->hasSettings() - ->create(); - - $teamFolder = Folder::factory() - ->create([ - 'user_id' => $user->id, - 'team_folder' => 1, - ]); - - $this - ->actingAs($user) - ->postJson('/api/create-folder', [ - 'name' => 'Inner Folder', - 'parent_id' => $teamFolder->id, - ]) - ->assertStatus(201) - ->assertJsonFragment([ - 'isTeamFolder' => true, - 'id' => $user->id, - ]); - } - - /** - * @test - */ - public function it_convert_folder_into_team_folder() - { - $user = User::factory() - ->hasSettings() - ->create(); - - $folder = Folder::factory() - ->create([ - 'user_id' => $user->id, - ]); - - $folderWithin = Folder::factory() - ->create([ - 'parent_id' => $folder->id, - 'user_id' => $user->id, - ]); - - $this - ->actingAs($user) - ->post("/api/teams/folders/{$folder->id}/convert", [ - 'invitations' => [ - [ - 'email' => 'john@internal.com', - 'permission' => 'can-edit', - ], - [ - 'email' => 'jane@external.com', - 'permission' => 'can-view', - ], - ], - ]) - ->assertCreated() - ->assertJsonFragment([ - 'name' => $folder->name, - ]); - - $this->assertDatabaseHas('folders', [ - 'id' => $folderWithin->id, - 'team_folder' => 1, - ]); - - Notification::assertTimesSent(2, InvitationIntoTeamFolder::class); - } - - /** - * @test - */ - public function it_get_all_team_folders() - { - $user = User::factory() - ->hasSettings() - ->create(); - - $folder = Folder::factory() - ->create([ - 'user_id' => $user->id, - 'team_folder' => 1, - ]); - - $this - ->actingAs($user) - ->getJson('/api/teams/folders/undefined') - ->assertOk() - ->assertJsonFragment([ - 'id' => $folder->id, - ]); - } - - /** - * @test - */ - public function it_get_content_of_team_folder() - { - $user = User::factory() - ->hasSettings() - ->create(); - - $folder = Folder::factory() - ->create([ - 'user_id' => $user->id, - 'team_folder' => 1, - ]); - - $file = File::factory() - ->create([ - 'parent_id' => $folder->id, - 'user_id' => $user->id, - ]); - - $this - ->actingAs($user) - ->getJson("/api/teams/folders/{$folder->id}") - ->assertOk() - ->assertJsonFragment([ - 'id' => $file->id, - ]); - } - - /** - * @test - */ - public function it_get_team_folders_shared_with_another_user() - { - $user = User::factory() - ->hasSettings() - ->create(); - - $member = User::factory() - ->hasSettings() - ->create(); - - $folders = Folder::factory() - ->count(2) - ->create([ - 'user_id' => $user->id, - 'team_folder' => 1, - ]); - - DB::table('team_folder_members') - ->insert([ - [ - 'parent_id' => $folders[0]->id, - 'user_id' => $member->id, - 'permission' => 'can-edit', - ], - [ - 'parent_id' => $folders[1]->id, - 'user_id' => $member->id, - 'permission' => 'can-edit', - ], - ]); - - $this - ->actingAs($member) - ->getJson('/api/teams/shared-with-me/undefined') - ->assertOk() - ->assertJsonFragment([ - 'id' => $folders[0]->id, - ]); - } - - /** - * @test - */ - public function team_member_upload_new_file() - { - $file = UploadedFile::fake() - ->create('fake-file.pdf', 12000000, 'application/pdf'); - - $user = User::factory() - ->hasSettings() - ->create(); - - $member = User::factory() - ->hasSettings() - ->create(); - - $folder = Folder::factory() - ->create([ - 'user_id' => $user->id, - 'team_folder' => 1, - ]); - - $this - ->actingAs($member) - ->postJson('/api/upload', [ - 'name' => $file->name, - 'extension' => 'pdf', - 'file' => $file, - 'parent_id' => $folder->id, - 'path' => "/$file->name", - 'is_last' => 'true', - ])->assertStatus(201); - - $this->assertDatabaseHas('files', [ - 'user_id' => $user->id, - 'creator_id' => $member->id, - ]); - } -} diff --git a/tests/Domain/UploadRequest/UploadRequestAccessTest.php b/tests/Domain/UploadRequest/UploadRequestAccessTest.php deleted file mode 100644 index 56b18523..00000000 --- a/tests/Domain/UploadRequest/UploadRequestAccessTest.php +++ /dev/null @@ -1,112 +0,0 @@ -hasSettings() - ->create(); - - $uploadRequest = UploadRequest::factory() - ->create([ - 'status' => 'active', - 'user_id' => $user->id, - 'created_at' => now(), - ]); - - $file = UploadedFile::fake() - ->create(Str::random() . '-fake-file.pdf', 1200, 'application/pdf'); - - Storage::putFileAs("files/$user->id", $file, $file->name); - - File::factory() - ->create([ - 'parent_id' => $uploadRequest->id, - 'basename' => $file->name, - 'user_id' => $user->id, - 'name' => $file->name, - ]); - - $this - ->get("/file/$file->name/upload-request/$uploadRequest->id") - ->assertDownload($file->name); - } - - /** - * @test - */ - public function it_get_thumbnail_from_upload_request_folder() - { - $user = User::factory() - ->hasSettings() - ->create(); - - $uploadRequest = UploadRequest::factory() - ->create([ - 'status' => 'active', - 'user_id' => $user->id, - 'created_at' => now(), - ]); - - $thumbnail = UploadedFile::fake() - ->image('fake-thumbnail.jpg'); - - Storage::putFileAs("files/$user->id", $thumbnail, $thumbnail->name); - - File::factory() - ->create([ - 'parent_id' => $uploadRequest->id, - 'basename' => 'fake-thumbnail.jpg', - 'user_id' => $user->id, - ]); - - $this - ->get("/thumbnail/xs-$thumbnail->name/upload-request/$uploadRequest->id") - ->assertDownload("xs-$thumbnail->name"); - } - - /** - * @test - */ - public function it_try_get_file_from_expired_upload_request_folder() - { - $uploadRequest = UploadRequest::factory() - ->create([ - 'status' => 'expired', - 'created_at' => now(), - ]); - - $this - ->get("/file/fake-file.pdf/upload-request/$uploadRequest->id") - ->assertStatus(410); - } - - /** - * @test - */ - public function it_try_get_thumbnail_from_expired_upload_request_folder() - { - $uploadRequest = UploadRequest::factory() - ->create([ - 'status' => 'filled', - 'created_at' => now(), - ]); - - $this - ->get("/thumbnail/xs-fake-thumbnail.jpeg/upload-request/$uploadRequest->id") - ->assertStatus(410); - } -} diff --git a/tests/Domain/UploadRequest/UploadRequestBrowsingTest.php b/tests/Domain/UploadRequest/UploadRequestBrowsingTest.php deleted file mode 100644 index 1a905ea5..00000000 --- a/tests/Domain/UploadRequest/UploadRequestBrowsingTest.php +++ /dev/null @@ -1,180 +0,0 @@ -hasSettings() - ->create(); - - $uploadRequest = UploadRequest::factory() - ->create([ - 'status' => 'active', - 'user_id' => $user->id, - ]); - - Folder::factory() - ->create([ - 'id' => $uploadRequest->id, - 'name' => 'Upload request', - 'user_id' => $user->id, - ]); - - $folder_level_1 = Folder::factory() - ->create([ - 'parent_id' => $uploadRequest->id, - 'name' => 'level 1', - 'user_id' => $user->id, - ]); - - $folder_level_2 = Folder::factory() - ->create([ - 'name' => 'level 2', - 'parent_id' => $folder_level_1->id, - 'user_id' => $user->id, - ]); - - $this - ->actingAs($user) - ->getJson("/api/upload-request/$uploadRequest->id/navigation") - ->assertStatus(200) - ->assertExactJson([ - [ - 'location' => 'upload-request', - 'name' => 'Upload Request', - 'folders' => [ - [ - 'id' => $folder_level_1->id, - 'parent_id' => $uploadRequest->id, - 'name' => 'level 1', - 'items' => 1, - 'trashed_items' => 1, - 'folders' => [ - [ - 'id' => $folder_level_2->id, - 'parent_id' => $folder_level_1->id, - 'name' => 'level 2', - 'items' => 0, - 'trashed_items' => 0, - 'folders' => [], - ], - ], - ], - ], - 'isMovable' => true, - 'isOpen' => true, - ], - ]); - } - - /** - * @test - */ - public function it_get_folder_content_for_upload_request_folder() - { - $user = User::factory() - ->hasSettings() - ->create(); - - $uploadRequest = UploadRequest::factory() - ->create([ - 'status' => 'active', - 'user_id' => $user->id, - ]); - - $root = Folder::factory() - ->create([ - 'id' => $uploadRequest->id, - 'name' => 'root', - 'user_id' => $user->id, - ]); - - $folder = Folder::factory() - ->create([ - 'parent_id' => $root->id, - 'author' => 'user', - 'user_id' => $user->id, - ]); - - $file = File::factory() - ->create([ - 'parent_id' => $root->id, - 'user_id' => $user->id, - ]); - - $this - ->actingAs($user) - ->getJson("/api/upload-request/$uploadRequest->id/browse/$root->id") - ->assertStatus(200) - ->assertJsonFragment([ - 'id' => $root->id, - ]) - ->assertJsonFragment([ - 'id' => $file->id, - ]) - ->assertJsonFragment([ - 'id' => $folder->id, - ]); - } - - /** - * @test - */ - public function it_get_folder_content_from_not_existed_upload_request_folder() - { - $user = User::factory() - ->hasSettings() - ->create(); - - $uploadRequest = UploadRequest::factory() - ->create([ - 'status' => 'active', - 'user_id' => $user->id, - ]); - - $root = Folder::factory() - ->create([ - 'id' => $uploadRequest->id, - 'name' => 'root', - 'user_id' => $user->id, - ]); - - $folder = Folder::factory() - ->create([ - 'parent_id' => $root->id, - 'author' => 'user', - 'user_id' => $user->id, - ]); - - $file = File::factory() - ->create([ - 'parent_id' => $root->id, - 'user_id' => $user->id, - ]); - - $this - ->actingAs($user) - ->getJson("/api/upload-request/$uploadRequest->id/browse/$root->id") - ->assertStatus(200) - ->assertJsonFragment([ - 'id' => $root->id, - ]) - ->assertJsonFragment([ - 'id' => $file->id, - ]) - ->assertJsonFragment([ - 'id' => $folder->id, - ]); - } -} diff --git a/tests/Domain/UploadRequest/UploadRequestEditingTest.php b/tests/Domain/UploadRequest/UploadRequestEditingTest.php deleted file mode 100644 index e6c34d15..00000000 --- a/tests/Domain/UploadRequest/UploadRequestEditingTest.php +++ /dev/null @@ -1,335 +0,0 @@ -hasSettings() - ->create(); - - $uploadRequest = UploadRequest::factory() - ->create([ - 'status' => 'active', - 'user_id' => $user->id, - ]); - - $folder = Folder::factory() - ->create([ - 'parent_id' => $uploadRequest->id, - 'user_id' => $user->id, - ]); - - $this - ->actingAs($user) - ->patchJson("/api/upload-request/$uploadRequest->id/rename/$folder->id", [ - 'name' => 'Renamed Folder', - 'type' => 'folder', - ]) - ->assertStatus(200) - ->assertJsonFragment([ - 'name' => 'Renamed Folder', - ]); - - $this->assertDatabaseHas('folders', [ - 'name' => 'Renamed Folder', - ]); - } - - /** - * @test - */ - public function it_rename_file_item() - { - $user = User::factory() - ->hasSettings() - ->create(); - - $uploadRequest = UploadRequest::factory() - ->create([ - 'status' => 'active', - 'user_id' => $user->id, - ]); - - $file = File::factory() - ->create([ - 'parent_id' => $uploadRequest->id, - 'user_id' => $user->id, - ]); - - $this - ->actingAs($user) - ->patchJson("/api/upload-request/$uploadRequest->id/rename/$file->id", [ - 'name' => 'Renamed File', - 'type' => 'file', - ]) - ->assertStatus(200) - ->assertJsonFragment([ - 'name' => 'Renamed File', - ]); - - $this->assertDatabaseHas('files', [ - 'name' => 'Renamed File', - ]); - } - - /** - * @test - */ - public function it_create_new_folder_in_upload_request() - { - $user = User::factory() - ->hasSettings() - ->create(); - - $uploadRequest = UploadRequest::factory() - ->create([ - 'status' => 'active', - 'user_id' => $user->id, - ]); - - $this - ->actingAs($user) - ->postJson("/api/upload-request/$uploadRequest->id/create-folder", [ - 'name' => 'New Folder', - 'parent_id' => $uploadRequest->id, - ]) - ->assertStatus(201) - ->assertJsonFragment([ - 'name' => 'New Folder', - ]); - - $this->assertDatabaseHas('folders', [ - 'name' => 'New Folder', - 'parent_id' => $uploadRequest->id, - ]); - } - - /** - * @test - */ - public function it_delete_image_with_their_thumbnails() - { - $user = User::factory() - ->hasSettings() - ->create(); - - $uploadRequest = UploadRequest::factory() - ->create([ - 'status' => 'active', - 'user_id' => $user->id, - ]); - - $image = File::factory() - ->create([ - 'mimetype' => 'jpeg', - 'type' => 'image', - 'basename' => 'fake-image.jpeg', - 'user_id' => $user->id, - 'parent_id' => $uploadRequest->id, - ]); - - // Mock files - $thumbnail_sizes = collect([ - config('vuefilemanager.image_sizes.later'), - config('vuefilemanager.image_sizes.immediately'), - ])->collapse(); - - $fakeFile = UploadedFile::fake() - ->create('fake-image.jpeg', 2000, 'image/jpeg'); - - Storage::putFileAs("files/$user->id", $fakeFile, $fakeFile->name); - - // Create fake image thumbnails - $thumbnail_sizes - ->each(function ($item) use ($user) { - $fakeFile = UploadedFile::fake() - ->create("{$item['name']}-fake-image.jpeg", 2000, 'image/jpeg'); - - Storage::putFileAs("files/$user->id", $fakeFile, $fakeFile->name); - }); - - $this - ->postJson("/api/upload-request/$uploadRequest->id/remove", [ - 'items' => [ - [ - 'id' => $image->id, - 'type' => 'file', - 'force_delete' => true, - ], - ], - ])->assertStatus(204); - - // Assert primary file was deleted - Storage::assertMissing("files/$user->id/fake-image.jpeg"); - - // Assert thumbnail was deleted - getThumbnailFileList('fake-image.jpeg') - ->each(fn ($thumbnail) => Storage::assertMissing("files/$user->id/$thumbnail")); - } - - /** - * @test - */ - public function it_delete_file() - { - $user = User::factory() - ->hasSettings() - ->create(); - - $uploadRequest = UploadRequest::factory() - ->create([ - 'status' => 'active', - 'user_id' => $user->id, - ]); - - $file = File::factory() - ->create([ - 'type' => 'file', - 'basename' => 'fake-file.pdf', - 'user_id' => $user->id, - 'parent_id' => $uploadRequest->id, - ]); - - $fakeFile = UploadedFile::fake() - ->create('fake-file.pdf', 1200, 'application/pdf'); - - Storage::putFileAs("files/$user->id", $fakeFile, $fakeFile->name); - - $this - ->postJson("/api/upload-request/$uploadRequest->id/remove", [ - 'items' => [ - [ - 'id' => $file->id, - 'type' => 'file', - 'force_delete' => true, - ], - ], - ])->assertStatus(204); - - // Assert primary file was deleted - Storage::assertMissing("files/$user->id/fake-file.pdf"); - } - - /** - * @test - */ - public function it_delete_folder_with_file_within() - { - $user = User::factory() - ->hasSettings() - ->create(); - - $uploadRequest = UploadRequest::factory() - ->create([ - 'status' => 'active', - 'user_id' => $user->id, - ]); - - $folder = Folder::factory() - ->create([ - 'user_id' => $user->id, - 'parent_id' => $uploadRequest->id, - ]); - - $folderWithin = Folder::factory() - ->create([ - 'user_id' => $user->id, - 'parent_id' => $folder->id, - ]); - - $file = File::factory() - ->create([ - 'type' => 'file', - 'basename' => 'fake-file.pdf', - 'user_id' => $user->id, - 'parent_id' => $folder->id, - ]); - - $fakeFile = UploadedFile::fake() - ->create('fake-file.pdf', 1200, 'application/pdf'); - - Storage::putFileAs("files/$user->id", $fakeFile, $fakeFile->name); - - $this - ->postJson("/api/upload-request/$uploadRequest->id/remove", [ - 'items' => [ - [ - 'id' => $folder->id, - 'type' => 'folder', - 'force_delete' => true, - ], - ], - ])->assertStatus(204); - - $this - ->assertDatabaseMissing('folders', [ - 'id' => $folder->id, - ]) - ->assertDatabaseMissing('folders', [ - 'id' => $folderWithin->id, - ]) - ->assertDatabaseMissing('files', [ - 'id' => $file->id, - ]); - - // Assert primary file was deleted - Storage::assertMissing("files/$user->id/fake-file.pdf"); - } - - /** - * @test - */ - public function it_move_file_to_another_folder_in_upload_request() - { - $user = User::factory() - ->hasSettings() - ->create(); - - $uploadRequest = UploadRequest::factory() - ->create([ - 'status' => 'active', - 'user_id' => $user->id, - ]); - - $folder = Folder::factory() - ->create([ - 'id' => $uploadRequest->id, - 'user_id' => $user->id, - ]); - - $file = File::factory() - ->create([ - 'parent_id' => $uploadRequest->id, - 'user_id' => $user->id, - ]); - - $this - ->postJson("/api/upload-request/$uploadRequest->id/move", [ - 'to_id' => $folder->id, - 'items' => [ - [ - 'type' => 'file', - 'id' => $file->id, - ], - ], - ])->assertStatus(204); - - $this->assertDatabaseHas('files', [ - 'id' => $file->id, - 'parent_id' => $folder->id, - ]); - } -} diff --git a/tests/Domain/UploadRequest/UploadRequestTest.php b/tests/Domain/UploadRequest/UploadRequestTest.php deleted file mode 100644 index e71345f4..00000000 --- a/tests/Domain/UploadRequest/UploadRequestTest.php +++ /dev/null @@ -1,333 +0,0 @@ -create(); - - $this->assertModelExists($uploadRequest); - } - - /** - * @test - */ - public function user_create_upload_request_with_email() - { - $user = User::factory() - ->hasSettings() - ->create(); - - $this - ->actingAs($user) - ->postJson('/api/upload-request', [ - 'folder_id' => '00cacdb9-1d09-4a32-8ad7-c0d45d66b758', - 'email' => 'howdy@hi5ve.digital', - 'notes' => 'Please send me your files...', - ]) - ->assertCreated(); - - $this->assertDatabasehas('upload_requests', [ - 'folder_id' => '00cacdb9-1d09-4a32-8ad7-c0d45d66b758', - 'email' => 'howdy@hi5ve.digital', - 'notes' => 'Please send me your files...', - ]); - - Notification::assertTimesSent(1, UploadRequestNotification::class); - } - - /** - * @test - */ - public function user_create_upload_request_without_email() - { - $user = User::factory() - ->hasSettings() - ->create(); - - $this - ->actingAs($user) - ->postJson('/api/upload-request', [ - 'folder_id' => '00cacdb9-1d09-4a32-8ad7-c0d45d66b758', - 'notes' => 'Please send me your files...', - ]) - ->assertCreated(); - - $this->assertDatabasehas('upload_requests', [ - 'folder_id' => '00cacdb9-1d09-4a32-8ad7-c0d45d66b758', - 'notes' => 'Please send me your files...', - 'email' => null, - ]); - - Notification::assertNothingSent(); - } - - /** - * @test - */ - public function user_create_upload_request_with_name() - { - $user = User::factory() - ->hasSettings() - ->create(); - - $this - ->actingAs($user) - ->postJson('/api/upload-request', [ - 'folder_id' => '00cacdb9-1d09-4a32-8ad7-c0d45d66b758', - 'notes' => 'Please send me your files...', - 'name' => 'My name', - ]) - ->assertCreated(); - - $this->assertDatabasehas('upload_requests', [ - 'folder_id' => '00cacdb9-1d09-4a32-8ad7-c0d45d66b758', - 'notes' => 'Please send me your files...', - 'email' => null, - 'name' => 'My name', - ]); - - Notification::assertNothingSent(); - } - - /** - * @test - */ - public function it_get_upload_request_detail() - { - $user = User::factory() - ->hasSettings() - ->create(); - - $uploadRequest = UploadRequest::factory() - ->create([ - 'status' => 'active', - 'user_id' => $user->id, - ]); - - $this->getJson("/api/upload-request/$uploadRequest->id") - ->assertOk() - ->assertJsonFragment([ - 'id' => $uploadRequest->id, - ]); - } - - /** - * @test - */ - public function it_upload_file_and_create_upload_request_folder_without_custom_folder_name() - { - $user = User::factory() - ->hasSettings() - ->create(); - - $uploadRequest = UploadRequest::factory() - ->create([ - 'status' => 'active', - 'user_id' => $user->id, - 'created_at' => now(), - 'name' => null, - ]); - - $file = UploadedFile::fake() - ->create('fake-file.pdf', 12000000, 'application/pdf'); - - $this - ->postJson("/api/upload-request/$uploadRequest->id/upload", [ - 'name' => $file->name, - 'extension' => 'pdf', - 'file' => $file, - 'parent_id' => null, - 'path' => "/$file->name", - 'is_last' => 'true', - ])->assertStatus(201); - - $this - ->assertDatabaseHas('upload_requests', [ - 'status' => 'filling', - ]) - ->assertDatabaseHas('folders', [ - 'id' => $uploadRequest->id, - 'name' => 'Upload Request from 01. Jan. 2021', - ])->assertDatabaseHas('files', [ - 'parent_id' => $uploadRequest->id, - ]); - - $file = File::first(); - - Storage::assertExists("files/$user->id/$file->basename"); - } - - /** - * @test - */ - public function it_upload_file_and_create_upload_request_folder_with_custom_folder_name() - { - $user = User::factory() - ->hasSettings() - ->create(); - - $uploadRequest = UploadRequest::factory() - ->create([ - 'status' => 'active', - 'user_id' => $user->id, - 'created_at' => now(), - 'name' => 'My Documents', - ]); - - $file = UploadedFile::fake() - ->create('fake-file.pdf', 12000000, 'application/pdf'); - - $this - ->postJson("/api/upload-request/$uploadRequest->id/upload", [ - 'name' => $file->name, - 'extension' => 'pdf', - 'file' => $file, - 'parent_id' => null, - 'path' => "/$file->name", - 'is_last' => 'true', - ])->assertStatus(201); - - $this - ->assertDatabaseHas('upload_requests', [ - 'status' => 'filling', - ]) - ->assertDatabaseHas('folders', [ - 'id' => $uploadRequest->id, - 'name' => 'My Documents', - ])->assertDatabaseHas('files', [ - 'parent_id' => $uploadRequest->id, - ]); - - $file = File::first(); - - Storage::assertExists("files/$user->id/$file->basename"); - } - - /** - * @test - */ - public function it_try_upload_file_into_non_active_upload_request() - { - $user = User::factory() - ->hasSettings() - ->create(); - - $uploadRequest = UploadRequest::factory() - ->create([ - 'status' => 'expired', - 'user_id' => $user->id, - 'created_at' => now(), - ]); - - $file = UploadedFile::fake() - ->create('fake-file.pdf', 12000000, 'application/pdf'); - - $this - ->postJson("/api/upload-request/$uploadRequest->id/upload", [ - 'name' => $file->name, - 'file' => $file, - 'parent_id' => null, - 'path' => "/$file->name", - 'is_last' => 'true', - ])->assertStatus(410); - } - - /** - * @test - */ - public function it_mark_upload_request_as_filled() - { - $user = User::factory() - ->hasSettings() - ->create(); - - $uploadRequest = UploadRequest::factory() - ->create([ - 'status' => 'active', - 'user_id' => $user->id, - ]); - - $this - ->deleteJson("/api/upload-request/$uploadRequest->id") - ->assertStatus(201) - ->assertJsonFragment([ - 'id' => $uploadRequest->id, - 'status' => 'filled', - ]); - - Notification::assertSentTo($user, UploadRequestFulfilledNotification::class); - } - - /** - * @test - */ - public function it_mark_upload_request_as_expired_after_72_hours() - { - UploadRequest::factory() - ->create([ - 'status' => 'active', - 'created_at' => now()->subHours(72), - ]); - - resolve(ExpireUnfilledUploadRequestAction::class)(); - - $this->assertDatabaseHas('upload_requests', [ - 'status' => 'expired', - ]); - } - - /** - * @test - */ - public function it_mark_upload_request_as_filled_3_hours_after_last_upload() - { - $user = User::factory() - ->hasSettings() - ->create(); - - $uploadRequest = UploadRequest::factory() - ->create([ - 'status' => 'active', - 'user_id' => $user->id, - 'created_at' => now(), - ]); - - $file = UploadedFile::fake() - ->create('fake-file.pdf', 12000000, 'application/pdf'); - - $this - ->postJson("/api/upload-request/$uploadRequest->id/upload", [ - 'name' => $file->name, - 'extension' => 'pdf', - 'file' => $file, - 'parent_id' => null, - 'path' => "/$file->name", - 'is_last' => 'true', - ])->assertCreated(); - - $this->travel(3)->hours(); - - resolve(ExpireUnfilledUploadRequestAction::class)(); - - $this->assertDatabaseHas('upload_requests', [ - 'status' => 'filled', - ]); - } -}