diff --git a/app/GraphQL/Ecosystem/Mutations/Companies/CompanyBranchManagementMutation.php b/app/GraphQL/Ecosystem/Mutations/Companies/CompanyBranchManagementMutation.php index 8998fc050..207ee7fb0 100644 --- a/app/GraphQL/Ecosystem/Mutations/Companies/CompanyBranchManagementMutation.php +++ b/app/GraphQL/Ecosystem/Mutations/Companies/CompanyBranchManagementMutation.php @@ -78,6 +78,8 @@ public function addUserToBranch($rootValue, array $request): bool $branch ); + $branch->set('total_users', $branch->users()->count()); + return true; } diff --git a/app/GraphQL/Ecosystem/Mutations/Companies/CompanyManagementMutation.php b/app/GraphQL/Ecosystem/Mutations/Companies/CompanyManagementMutation.php index 4f8c4c321..5512cf5d3 100644 --- a/app/GraphQL/Ecosystem/Mutations/Companies/CompanyManagementMutation.php +++ b/app/GraphQL/Ecosystem/Mutations/Companies/CompanyManagementMutation.php @@ -12,6 +12,7 @@ use Kanvas\Companies\Actions\UpdateCompaniesAction; use Kanvas\Companies\DataTransferObject\CompaniesPostData; use Kanvas\Companies\DataTransferObject\CompaniesPutData; +use Kanvas\Companies\Jobs\DeleteCompanyJob; use Kanvas\Companies\Models\Companies; use Kanvas\Companies\Models\CompaniesBranches; use Kanvas\Companies\Repositories\CompaniesRepository; @@ -65,8 +66,7 @@ public function deleteCompany(mixed $root, array $request): bool /** * @todo only super admin can do this */ - $companyDelete = new DeleteCompaniesAction(Auth::user()); - $companyDelete->execute((int) $request['id']); + DeleteCompanyJob::dispatch((int) $request['id'], Auth::user()); return true; } diff --git a/app/GraphQL/Ecosystem/Mutations/Config/ConfigManagement.php b/app/GraphQL/Ecosystem/Mutations/Config/ConfigManagement.php index 1536b6c6f..41c5c6769 100644 --- a/app/GraphQL/Ecosystem/Mutations/Config/ConfigManagement.php +++ b/app/GraphQL/Ecosystem/Mutations/Config/ConfigManagement.php @@ -5,10 +5,9 @@ namespace App\GraphQL\Ecosystem\Mutations\Config; use Kanvas\Apps\Models\Apps; -use Kanvas\Companies\Models\Companies; +use Kanvas\Companies\Repositories\CompaniesRepository; use Kanvas\Users\Models\Users; use Kanvas\Users\Repositories\UsersRepository; -use Kanvas\Companies\Repositories\CompaniesRepository; class ConfigManagement { @@ -44,7 +43,7 @@ public function setCompanySetting(mixed $root, array $request): bool public function deleteCompanySetting(mixed $root, array $request): bool { $companies = CompaniesRepository::getByUuid($request['input']['entity_uuid'], app(Apps::class)); - $companies->delete($request['input']['key']); + $companies->del($request['input']['key']); return true; } diff --git a/app/GraphQL/Social/Builders/Messages/MessageBuilder.php b/app/GraphQL/Social/Builders/Messages/MessageBuilder.php index 4d0178a2c..ef1ca2b29 100644 --- a/app/GraphQL/Social/Builders/Messages/MessageBuilder.php +++ b/app/GraphQL/Social/Builders/Messages/MessageBuilder.php @@ -22,4 +22,19 @@ public function getAll( */ return Message::fromApp(); } + + public function getChannelMessages( + mixed $root, + array $args, + GraphQLContext $context, + ResolveInfo $resolveInfo + ): Builder { + return Message::fromApp()->whereHas('channels', function ($query) use ($args) { + $query->where('channels.uuid', $args['channel_uuid']); + }) + ->when(! auth()->user()->isAdmin(), function ($query) { + $query->where('companies_id', auth()->user()->currentCompanyId()); + }) + ->select('messages.*'); + } } diff --git a/app/GraphQL/Social/Mutations/Channels/ChannelsManagementMutation.php b/app/GraphQL/Social/Mutations/Channels/ChannelsManagementMutation.php index 4efe36ee2..cb7bda3d6 100644 --- a/app/GraphQL/Social/Mutations/Channels/ChannelsManagementMutation.php +++ b/app/GraphQL/Social/Mutations/Channels/ChannelsManagementMutation.php @@ -12,6 +12,7 @@ use Kanvas\Social\Channels\Repositories\ChannelRepository; use Kanvas\SystemModules\Repositories\SystemModulesRepository; use Kanvas\Users\Models\Users; +use Baka\Support\Str; class ChannelsManagementMutation { @@ -26,6 +27,7 @@ public function createChannel(mixed $rootValue, array $request): Channel description: $request['input']['description'], entity_id: $request['input']['entity_id'], entity_namespace: $systemModule->uuid, + slug: $request['input']['slug'] ?? Str::slug($request['input']['name']) ); $createChannel = new CreateChannelAction($channelDto); diff --git a/app/Providers/EventServiceProvider.php b/app/Providers/EventServiceProvider.php index 052bfd3a2..d0e34621d 100644 --- a/app/Providers/EventServiceProvider.php +++ b/app/Providers/EventServiceProvider.php @@ -21,6 +21,8 @@ use Kanvas\Inventory\Warehouses\Models\Warehouses; use Kanvas\Inventory\Warehouses\Observers\VariantsWarehouseObserver; use Kanvas\Inventory\Warehouses\Observers\WarehouseObserver; +use Kanvas\Notifications\Events\PushNotificationsEvent; +use Kanvas\Notifications\Listeners\NotificationsListener; use Kanvas\Social\Messages\Models\UserMessage; use Kanvas\Social\Messages\Models\UserMessageActivity; use Kanvas\Social\Messages\Observers\UserMessageActivityObserver; @@ -28,9 +30,11 @@ use Kanvas\Social\UsersLists\Models\UserList; use Kanvas\Social\UsersLists\Observers\UsersListsObserver; use Kanvas\Users\Models\Users; +use Kanvas\Users\Models\UsersAssociatedApps; +use Kanvas\Users\Observers\UsersAssociatedAppsObserver; use Kanvas\Users\Observers\UsersObserver; -use Kanvas\Notifications\Events\PushNotificationsEvent; -use Kanvas\Notifications\Listeners\NotificationsListener; +use Kanvas\Users\Models\UserCompanyApps; +use Kanvas\Users\Observers\UsersAssociatedCompaniesObserver; class EventServiceProvider extends ServiceProvider { @@ -64,6 +68,8 @@ public function boot() VariantsWarehouses::observe(VariantsWarehouseObserver::class); Channels::observe(ChannelObserver::class); VariantsChannels::observe(VariantsChannelObserver::class); + UsersAssociatedApps::observe(UsersAssociatedAppsObserver::class); + UserCompanyApps::observe(UsersAssociatedCompaniesObserver::class); } /** diff --git a/composer.json b/composer.json index d50d0adc8..03b80ba6a 100644 --- a/composer.json +++ b/composer.json @@ -26,7 +26,7 @@ "laravel/scout": "^10.2", "laravel/socialite": "^5.6", "laravel/tinker": "^2.7", - "lcobucci/jwt": "^4.3", + "lcobucci/jwt": "^5.2", "league/flysystem-aws-s3-v3": "^3.12", "meilisearch/meilisearch-php": "^1.4", "mll-lab/graphql-php-scalars": "^6.0", @@ -34,7 +34,7 @@ "nuwave/lighthouse": "^6.0", "phpclassic/php-shopify": "^1.2", "powersync/authorizenet-sdk-php": "^2.0", - "sentry/sentry-laravel": "^3.2", + "sentry/sentry-laravel": "^4.2", "shopify/shopify-api": "^5.3", "silber/bouncer": "^1.0", "spatie/data-transfer-object": "^3.7", @@ -43,9 +43,9 @@ "spatie/laravel-health": "^1.22", "spatie/laravel-queueable-action": "^2.14", "spatie/laravel-webhook-server": "^3.4", - "symfony/expression-language": "^6.3", - "symfony/http-client": "^6.2", - "symfony/mailgun-mailer": "^6.2", + "symfony/expression-language": "^7.0", + "symfony/http-client": "^7.0", + "symfony/mailgun-mailer": "^7.0", "timokoerber/laravel-one-time-operations": "^1.4", "vladimir-yuldashev/laravel-queue-rabbitmq": "^13.3", "vlucas/phpdotenv": "^5.5", diff --git a/composer.lock b/composer.lock index 6677ea673..f5427ba8d 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": "b0bae17774a50f30b584d586bfeccef8", + "content-hash": "2ab8b36baa501ff1b5f223119737e059", "packages": [ { "name": "amphp/amp", @@ -732,16 +732,16 @@ }, { "name": "aws/aws-sdk-php", - "version": "3.298.2", + "version": "3.298.7", "source": { "type": "git", "url": "https://github.com/aws/aws-sdk-php.git", - "reference": "626f731c38e06ea483025334512f4c2afea1739d" + "reference": "b4d98bfc70df146774bf9b04f5ac5b39955fbad2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/626f731c38e06ea483025334512f4c2afea1739d", - "reference": "626f731c38e06ea483025334512f4c2afea1739d", + "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/b4d98bfc70df146774bf9b04f5ac5b39955fbad2", + "reference": "b4d98bfc70df146774bf9b04f5ac5b39955fbad2", "shasum": "" }, "require": { @@ -821,22 +821,22 @@ "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.298.2" + "source": "https://github.com/aws/aws-sdk-php/tree/3.298.7" }, - "time": "2024-02-02T19:05:34+00:00" + "time": "2024-02-09T19:07:04+00:00" }, { "name": "berkayk/onesignal-laravel", - "version": "v2", + "version": "v2.0.1", "source": { "type": "git", "url": "https://github.com/berkayk/laravel-onesignal.git", - "reference": "e37aaf474903789f20239949c73e20382bd623bf" + "reference": "2eeca4d516ae791a6d764f0c605186b7d5d1c95e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/berkayk/laravel-onesignal/zipball/e37aaf474903789f20239949c73e20382bd623bf", - "reference": "e37aaf474903789f20239949c73e20382bd623bf", + "url": "https://api.github.com/repos/berkayk/laravel-onesignal/zipball/2eeca4d516ae791a6d764f0c605186b7d5d1c95e", + "reference": "2eeca4d516ae791a6d764f0c605186b7d5d1c95e", "shasum": "" }, "require": { @@ -889,9 +889,9 @@ ], "support": { "issues": "https://github.com/berkayk/laravel-onesignal/issues", - "source": "https://github.com/berkayk/laravel-onesignal/tree/v2" + "source": "https://github.com/berkayk/laravel-onesignal/tree/v2.0.1" }, - "time": "2023-02-21T08:06:05+00:00" + "time": "2024-02-09T15:51:26+00:00" }, { "name": "brick/math", @@ -1361,27 +1361,27 @@ }, { "name": "doctrine/lexer", - "version": "3.0.0", + "version": "3.0.1", "source": { "type": "git", "url": "https://github.com/doctrine/lexer.git", - "reference": "84a527db05647743d50373e0ec53a152f2cde568" + "reference": "31ad66abc0fc9e1a1f2d9bc6a42668d2fbbcd6dd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/lexer/zipball/84a527db05647743d50373e0ec53a152f2cde568", - "reference": "84a527db05647743d50373e0ec53a152f2cde568", + "url": "https://api.github.com/repos/doctrine/lexer/zipball/31ad66abc0fc9e1a1f2d9bc6a42668d2fbbcd6dd", + "reference": "31ad66abc0fc9e1a1f2d9bc6a42668d2fbbcd6dd", "shasum": "" }, "require": { "php": "^8.1" }, "require-dev": { - "doctrine/coding-standard": "^10", - "phpstan/phpstan": "^1.9", - "phpunit/phpunit": "^9.5", + "doctrine/coding-standard": "^12", + "phpstan/phpstan": "^1.10", + "phpunit/phpunit": "^10.5", "psalm/plugin-phpunit": "^0.18.3", - "vimeo/psalm": "^5.0" + "vimeo/psalm": "^5.21" }, "type": "library", "autoload": { @@ -1418,7 +1418,7 @@ ], "support": { "issues": "https://github.com/doctrine/lexer/issues", - "source": "https://github.com/doctrine/lexer/tree/3.0.0" + "source": "https://github.com/doctrine/lexer/tree/3.0.1" }, "funding": [ { @@ -1434,7 +1434,7 @@ "type": "tidelift" } ], - "time": "2022-12-15T16:57:16+00:00" + "time": "2024-02-05T11:56:58+00:00" }, { "name": "dragonmantank/cron-expression", @@ -2103,21 +2103,21 @@ }, { "name": "google/cloud-core", - "version": "v1.54.0", + "version": "v1.55.0", "source": { "type": "git", "url": "https://github.com/googleapis/google-cloud-php-core.git", - "reference": "cd3f670dbb7f6a5b9b550b0d1b8e5b6ed148fb58" + "reference": "45c8e6e0511944b410bb788a940b2a1ab75975ff" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/googleapis/google-cloud-php-core/zipball/cd3f670dbb7f6a5b9b550b0d1b8e5b6ed148fb58", - "reference": "cd3f670dbb7f6a5b9b550b0d1b8e5b6ed148fb58", + "url": "https://api.github.com/repos/googleapis/google-cloud-php-core/zipball/45c8e6e0511944b410bb788a940b2a1ab75975ff", + "reference": "45c8e6e0511944b410bb788a940b2a1ab75975ff", "shasum": "" }, "require": { "google/auth": "^1.34", - "google/gax": "^1.26.3", + "google/gax": "^1.27.0", "guzzlehttp/guzzle": "^6.5.8|^7.4.4", "guzzlehttp/promises": "^1.4||^2.0", "guzzlehttp/psr7": "^2.6", @@ -2163,9 +2163,9 @@ ], "description": "Google Cloud PHP shared dependency, providing functionality useful to all components.", "support": { - "source": "https://github.com/googleapis/google-cloud-php-core/tree/v1.54.0" + "source": "https://github.com/googleapis/google-cloud-php-core/tree/v1.55.0" }, - "time": "2024-01-26T20:27:24+00:00" + "time": "2024-02-09T19:51:53+00:00" }, { "name": "google/cloud-storage", @@ -2278,16 +2278,16 @@ }, { "name": "google/gax", - "version": "v1.26.3", + "version": "v1.27.0", "source": { "type": "git", "url": "https://github.com/googleapis/gax-php.git", - "reference": "b7c782dcc40957ad84c9da947cc201f42e97859e" + "reference": "7d2533e84480018a351e9c3e20a284342ea7a75e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/googleapis/gax-php/zipball/b7c782dcc40957ad84c9da947cc201f42e97859e", - "reference": "b7c782dcc40957ad84c9da947cc201f42e97859e", + "url": "https://api.github.com/repos/googleapis/gax-php/zipball/7d2533e84480018a351e9c3e20a284342ea7a75e", + "reference": "7d2533e84480018a351e9c3e20a284342ea7a75e", "shasum": "" }, "require": { @@ -2327,9 +2327,9 @@ ], "support": { "issues": "https://github.com/googleapis/gax-php/issues", - "source": "https://github.com/googleapis/gax-php/tree/v1.26.3" + "source": "https://github.com/googleapis/gax-php/tree/v1.27.0" }, - "time": "2024-01-18T20:24:45+00:00" + "time": "2024-02-07T23:12:02+00:00" }, { "name": "google/grpc-gcp", @@ -4029,105 +4029,40 @@ }, "time": "2024-01-04T16:10:04+00:00" }, - { - "name": "lcobucci/clock", - "version": "3.2.0", - "source": { - "type": "git", - "url": "https://github.com/lcobucci/clock.git", - "reference": "6f28b826ea01306b07980cb8320ab30b966cd715" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/lcobucci/clock/zipball/6f28b826ea01306b07980cb8320ab30b966cd715", - "reference": "6f28b826ea01306b07980cb8320ab30b966cd715", - "shasum": "" - }, - "require": { - "php": "~8.2.0 || ~8.3.0", - "psr/clock": "^1.0" - }, - "provide": { - "psr/clock-implementation": "1.0" - }, - "require-dev": { - "infection/infection": "^0.27", - "lcobucci/coding-standard": "^11.0.0", - "phpstan/extension-installer": "^1.3.1", - "phpstan/phpstan": "^1.10.25", - "phpstan/phpstan-deprecation-rules": "^1.1.3", - "phpstan/phpstan-phpunit": "^1.3.13", - "phpstan/phpstan-strict-rules": "^1.5.1", - "phpunit/phpunit": "^10.2.3" - }, - "type": "library", - "autoload": { - "psr-4": { - "Lcobucci\\Clock\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Luís Cobucci", - "email": "lcobucci@gmail.com" - } - ], - "description": "Yet another clock abstraction", - "support": { - "issues": "https://github.com/lcobucci/clock/issues", - "source": "https://github.com/lcobucci/clock/tree/3.2.0" - }, - "funding": [ - { - "url": "https://github.com/lcobucci", - "type": "github" - }, - { - "url": "https://www.patreon.com/lcobucci", - "type": "patreon" - } - ], - "time": "2023-11-17T17:00:27+00:00" - }, { "name": "lcobucci/jwt", - "version": "4.3.0", + "version": "5.2.0", "source": { "type": "git", "url": "https://github.com/lcobucci/jwt.git", - "reference": "4d7de2fe0d51a96418c0d04004986e410e87f6b4" + "reference": "0ba88aed12c04bd2ed9924f500673f32b67a6211" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/lcobucci/jwt/zipball/4d7de2fe0d51a96418c0d04004986e410e87f6b4", - "reference": "4d7de2fe0d51a96418c0d04004986e410e87f6b4", + "url": "https://api.github.com/repos/lcobucci/jwt/zipball/0ba88aed12c04bd2ed9924f500673f32b67a6211", + "reference": "0ba88aed12c04bd2ed9924f500673f32b67a6211", "shasum": "" }, "require": { - "ext-hash": "*", - "ext-json": "*", - "ext-mbstring": "*", "ext-openssl": "*", "ext-sodium": "*", - "lcobucci/clock": "^2.0 || ^3.0", - "php": "^7.4 || ^8.0" + "php": "~8.1.0 || ~8.2.0 || ~8.3.0", + "psr/clock": "^1.0" }, "require-dev": { - "infection/infection": "^0.21", - "lcobucci/coding-standard": "^6.0", - "mikey179/vfsstream": "^1.6.7", - "phpbench/phpbench": "^1.2", - "phpstan/extension-installer": "^1.0", - "phpstan/phpstan": "^1.4", - "phpstan/phpstan-deprecation-rules": "^1.0", - "phpstan/phpstan-phpunit": "^1.0", - "phpstan/phpstan-strict-rules": "^1.0", - "phpunit/php-invoker": "^3.1", - "phpunit/phpunit": "^9.5" + "infection/infection": "^0.27.0", + "lcobucci/clock": "^3.0", + "lcobucci/coding-standard": "^11.0", + "phpbench/phpbench": "^1.2.9", + "phpstan/extension-installer": "^1.2", + "phpstan/phpstan": "^1.10.7", + "phpstan/phpstan-deprecation-rules": "^1.1.3", + "phpstan/phpstan-phpunit": "^1.3.10", + "phpstan/phpstan-strict-rules": "^1.5.0", + "phpunit/phpunit": "^10.2.6" + }, + "suggest": { + "lcobucci/clock": ">= 3.0" }, "type": "library", "autoload": { @@ -4153,7 +4088,7 @@ ], "support": { "issues": "https://github.com/lcobucci/jwt/issues", - "source": "https://github.com/lcobucci/jwt/tree/4.3.0" + "source": "https://github.com/lcobucci/jwt/tree/5.2.0" }, "funding": [ { @@ -4165,7 +4100,7 @@ "type": "patreon" } ], - "time": "2023-01-02T13:28:00+00:00" + "time": "2023-11-20T21:17:42+00:00" }, { "name": "league/commonmark", @@ -6275,61 +6210,6 @@ }, "time": "2023-05-17T06:43:38+00:00" }, - { - "name": "php-http/message-factory", - "version": "1.1.0", - "source": { - "type": "git", - "url": "https://github.com/php-http/message-factory.git", - "reference": "4d8778e1c7d405cbb471574821c1ff5b68cc8f57" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-http/message-factory/zipball/4d8778e1c7d405cbb471574821c1ff5b68cc8f57", - "reference": "4d8778e1c7d405cbb471574821c1ff5b68cc8f57", - "shasum": "" - }, - "require": { - "php": ">=5.4", - "psr/http-message": "^1.0 || ^2.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Http\\Message\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com" - } - ], - "description": "Factory interfaces for PSR-7 HTTP Message", - "homepage": "http://php-http.org", - "keywords": [ - "factory", - "http", - "message", - "stream", - "uri" - ], - "support": { - "issues": "https://github.com/php-http/message-factory/issues", - "source": "https://github.com/php-http/message-factory/tree/1.1.0" - }, - "abandoned": "psr/http-factory", - "time": "2023-04-14T14:16:17+00:00" - }, { "name": "php-http/promise", "version": "1.3.0", @@ -7722,112 +7602,42 @@ ], "time": "2022-10-12T17:22:51+00:00" }, - { - "name": "sentry/sdk", - "version": "3.6.0", - "source": { - "type": "git", - "url": "https://github.com/getsentry/sentry-php-sdk.git", - "reference": "24c235ff2027401cbea099bf88689e1a1f197c7a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/getsentry/sentry-php-sdk/zipball/24c235ff2027401cbea099bf88689e1a1f197c7a", - "reference": "24c235ff2027401cbea099bf88689e1a1f197c7a", - "shasum": "" - }, - "require": { - "http-interop/http-factory-guzzle": "^1.0", - "sentry/sentry": "^3.22", - "symfony/http-client": "^4.3|^5.0|^6.0|^7.0" - }, - "type": "metapackage", - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Sentry", - "email": "accounts@sentry.io" - } - ], - "description": "This is a metapackage shipping sentry/sentry with a recommended HTTP client.", - "homepage": "http://sentry.io", - "keywords": [ - "crash-reporting", - "crash-reports", - "error-handler", - "error-monitoring", - "log", - "logging", - "sentry" - ], - "support": { - "issues": "https://github.com/getsentry/sentry-php-sdk/issues", - "source": "https://github.com/getsentry/sentry-php-sdk/tree/3.6.0" - }, - "funding": [ - { - "url": "https://sentry.io/", - "type": "custom" - }, - { - "url": "https://sentry.io/pricing/", - "type": "custom" - } - ], - "time": "2023-12-04T10:49:33+00:00" - }, { "name": "sentry/sentry", - "version": "3.22.1", + "version": "4.5.0", "source": { "type": "git", "url": "https://github.com/getsentry/sentry-php.git", - "reference": "8859631ba5ab15bc1af420b0eeed19ecc6c9d81d" + "reference": "a6e06f0b7a17e7f68e11297427da76bfe01a3ca3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/getsentry/sentry-php/zipball/8859631ba5ab15bc1af420b0eeed19ecc6c9d81d", - "reference": "8859631ba5ab15bc1af420b0eeed19ecc6c9d81d", + "url": "https://api.github.com/repos/getsentry/sentry-php/zipball/a6e06f0b7a17e7f68e11297427da76bfe01a3ca3", + "reference": "a6e06f0b7a17e7f68e11297427da76bfe01a3ca3", "shasum": "" }, "require": { + "ext-curl": "*", "ext-json": "*", "ext-mbstring": "*", - "guzzlehttp/promises": "^1.5.3|^2.0", + "guzzlehttp/psr7": "^1.8.4|^2.1.1", "jean85/pretty-package-versions": "^1.5|^2.0.4", "php": "^7.2|^8.0", - "php-http/async-client-implementation": "^1.0", - "php-http/client-common": "^1.5|^2.0", - "php-http/discovery": "^1.15", - "php-http/httplug": "^1.1|^2.0", - "php-http/message": "^1.5", - "php-http/message-factory": "^1.1", - "psr/http-factory": "^1.0", - "psr/http-factory-implementation": "^1.0", "psr/log": "^1.0|^2.0|^3.0", - "symfony/options-resolver": "^3.4.43|^4.4.30|^5.0.11|^6.0|^7.0", - "symfony/polyfill-php80": "^1.17" + "symfony/options-resolver": "^4.4.30|^5.0.11|^6.0|^7.0" }, "conflict": { - "php-http/client-common": "1.8.0", "raven/raven": "*" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^2.19|3.4.*", + "friendsofphp/php-cs-fixer": "^3.4", + "guzzlehttp/promises": "^1.0|^2.0", "guzzlehttp/psr7": "^1.8.4|^2.1.1", - "http-interop/http-factory-guzzle": "^1.0", "monolog/monolog": "^1.6|^2.0|^3.0", - "nikic/php-parser": "^4.10.3", - "php-http/mock-client": "^1.3", "phpbench/phpbench": "^1.0", - "phpstan/extension-installer": "^1.0", "phpstan/phpstan": "^1.3", - "phpstan/phpstan-phpunit": "^1.0", "phpunit/phpunit": "^8.5.14|^9.4", - "symfony/phpunit-bridge": "^5.2|^6.0", + "symfony/phpunit-bridge": "^5.2|^6.0|^7.0", "vimeo/psalm": "^4.17" }, "suggest": { @@ -7852,7 +7662,7 @@ "email": "accounts@sentry.io" } ], - "description": "A PHP SDK for Sentry (http://sentry.io)", + "description": "PHP SDK for Sentry (http://sentry.io)", "homepage": "http://sentry.io", "keywords": [ "crash-reporting", @@ -7861,11 +7671,13 @@ "error-monitoring", "log", "logging", - "sentry" + "profiling", + "sentry", + "tracing" ], "support": { "issues": "https://github.com/getsentry/sentry-php/issues", - "source": "https://github.com/getsentry/sentry-php/tree/3.22.1" + "source": "https://github.com/getsentry/sentry-php/tree/4.5.0" }, "funding": [ { @@ -7877,47 +7689,42 @@ "type": "custom" } ], - "time": "2023-11-13T11:47:28+00:00" + "time": "2024-01-29T16:16:10+00:00" }, { "name": "sentry/sentry-laravel", - "version": "3.8.2", + "version": "4.2.0", "source": { "type": "git", "url": "https://github.com/getsentry/sentry-laravel.git", - "reference": "1293e5732f8405e12f000cdf5dee78c927a18de0" + "reference": "054638ac05d7668e8b2c636e66fed5b5b468f11f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/getsentry/sentry-laravel/zipball/1293e5732f8405e12f000cdf5dee78c927a18de0", - "reference": "1293e5732f8405e12f000cdf5dee78c927a18de0", + "url": "https://api.github.com/repos/getsentry/sentry-laravel/zipball/054638ac05d7668e8b2c636e66fed5b5b468f11f", + "reference": "054638ac05d7668e8b2c636e66fed5b5b468f11f", "shasum": "" }, "require": { "illuminate/support": "^6.0 | ^7.0 | ^8.0 | ^9.0 | ^10.0", "nyholm/psr7": "^1.0", "php": "^7.2 | ^8.0", - "sentry/sdk": "^3.4", - "sentry/sentry": "^3.20.1", - "symfony/psr-http-message-bridge": "^1.0 | ^2.0" + "sentry/sentry": "^4.5", + "symfony/psr-http-message-bridge": "^1.0 | ^2.0 | ^6.0 | ^7.0" }, "require-dev": { "friendsofphp/php-cs-fixer": "^3.11", + "guzzlehttp/guzzle": "^7.2", "laravel/folio": "^1.0", "laravel/framework": "^6.0 | ^7.0 | ^8.0 | ^9.0 | ^10.0", + "livewire/livewire": "^2.0 | ^3.0", "mockery/mockery": "^1.3", "orchestra/testbench": "^4.7 | ^5.1 | ^6.0 | ^7.0 | ^8.0", "phpstan/phpstan": "^1.10", - "phpunit/phpunit": "^8.4 | ^9.3" + "phpunit/phpunit": "^8.4 | ^9.3 | ^10.4" }, "type": "library", "extra": { - "branch-alias": { - "dev-master": "3.x-dev", - "dev-2.x": "2.x-dev", - "dev-1.x": "1.x-dev", - "dev-0.x": "0.x-dev" - }, "laravel": { "providers": [ "Sentry\\Laravel\\ServiceProvider", @@ -7953,11 +7760,13 @@ "laravel", "log", "logging", - "sentry" + "profiling", + "sentry", + "tracing" ], "support": { "issues": "https://github.com/getsentry/sentry-laravel/issues", - "source": "https://github.com/getsentry/sentry-laravel/tree/3.8.2" + "source": "https://github.com/getsentry/sentry-laravel/tree/4.2.0" }, "funding": [ { @@ -7969,7 +7778,7 @@ "type": "custom" } ], - "time": "2023-10-12T14:38:46+00:00" + "time": "2024-01-29T17:08:18+00:00" }, { "name": "shopify/shopify-api", @@ -8418,16 +8227,16 @@ }, { "name": "spatie/laravel-health", - "version": "1.25.0", + "version": "1.26.1", "source": { "type": "git", "url": "https://github.com/spatie/laravel-health.git", - "reference": "b313ffea980dc1c23a0503d846efb7a5ce469cfb" + "reference": "1cd60ad2cfa98d6376af25c56df876f6a3229a91" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/laravel-health/zipball/b313ffea980dc1c23a0503d846efb7a5ce469cfb", - "reference": "b313ffea980dc1c23a0503d846efb7a5ce469cfb", + "url": "https://api.github.com/repos/spatie/laravel-health/zipball/1cd60ad2cfa98d6376af25c56df876f6a3229a91", + "reference": "1cd60ad2cfa98d6376af25c56df876f6a3229a91", "shasum": "" }, "require": { @@ -8499,7 +8308,7 @@ "spatie" ], "support": { - "source": "https://github.com/spatie/laravel-health/tree/1.25.0" + "source": "https://github.com/spatie/laravel-health/tree/1.26.1" }, "funding": [ { @@ -8507,20 +8316,20 @@ "type": "github" } ], - "time": "2024-02-03T10:06:35+00:00" + "time": "2024-02-12T08:35:17+00:00" }, { "name": "spatie/laravel-model-states", - "version": "2.6.0", + "version": "2.6.1", "source": { "type": "git", "url": "https://github.com/spatie/laravel-model-states.git", - "reference": "f47e21637aa6133d9415b6ba20f208805a97d166" + "reference": "fc078514e0910559e803306972df7bef7600ae82" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/laravel-model-states/zipball/f47e21637aa6133d9415b6ba20f208805a97d166", - "reference": "f47e21637aa6133d9415b6ba20f208805a97d166", + "url": "https://api.github.com/repos/spatie/laravel-model-states/zipball/fc078514e0910559e803306972df7bef7600ae82", + "reference": "fc078514e0910559e803306972df7bef7600ae82", "shasum": "" }, "require": { @@ -8570,7 +8379,7 @@ "state" ], "support": { - "source": "https://github.com/spatie/laravel-model-states/tree/2.6.0" + "source": "https://github.com/spatie/laravel-model-states/tree/2.6.1" }, "funding": [ { @@ -8582,7 +8391,7 @@ "type": "github" } ], - "time": "2023-09-27T06:55:57+00:00" + "time": "2024-02-07T18:56:55+00:00" }, { "name": "spatie/laravel-package-tools", @@ -8731,32 +8540,32 @@ }, { "name": "spatie/laravel-webhook-server", - "version": "3.8.0", + "version": "3.8.1", "source": { "type": "git", "url": "https://github.com/spatie/laravel-webhook-server.git", - "reference": "bdcd23abd78805705a5ac29a66fddefea3fd32a0" + "reference": "d4cc24141a4d6a148e110df5f36217cc8f40f07e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/laravel-webhook-server/zipball/bdcd23abd78805705a5ac29a66fddefea3fd32a0", - "reference": "bdcd23abd78805705a5ac29a66fddefea3fd32a0", + "url": "https://api.github.com/repos/spatie/laravel-webhook-server/zipball/d4cc24141a4d6a148e110df5f36217cc8f40f07e", + "reference": "d4cc24141a4d6a148e110df5f36217cc8f40f07e", "shasum": "" }, "require": { "ext-json": "*", "guzzlehttp/guzzle": "^6.3|^7.3", - "illuminate/bus": "^8.50|^9.0|^10.0", - "illuminate/queue": "^8.50|^9.0|^10.0", - "illuminate/support": "^8.50|^9.0|^10.0", + "illuminate/bus": "^8.50|^9.0|^10.0|^11.0", + "illuminate/queue": "^8.50|^9.0|^10.0|^11.0", + "illuminate/support": "^8.50|^9.0|^10.0|^11.0", "php": "^8.0", "spatie/laravel-package-tools": "^1.11" }, "require-dev": { "mockery/mockery": "^1.4.3", - "orchestra/testbench": "^6.19|^7.0", - "pestphp/pest": "^1.22", - "pestphp/pest-plugin-laravel": "^1.3", + "orchestra/testbench": "^6.19|^7.0|^8.0", + "pestphp/pest": "^1.22|^2.0", + "pestphp/pest-plugin-laravel": "^1.3|^2.0", "spatie/test-time": "^1.2.2" }, "type": "library", @@ -8793,7 +8602,7 @@ "webhook" ], "support": { - "source": "https://github.com/spatie/laravel-webhook-server/tree/3.8.0" + "source": "https://github.com/spatie/laravel-webhook-server/tree/3.8.1" }, "funding": [ { @@ -8801,7 +8610,7 @@ "type": "custom" } ], - "time": "2023-11-27T11:46:04+00:00" + "time": "2024-02-12T08:18:25+00:00" }, { "name": "spatie/php-structure-discoverer", @@ -9639,22 +9448,21 @@ }, { "name": "symfony/expression-language", - "version": "v6.4.3", + "version": "v7.0.3", "source": { "type": "git", "url": "https://github.com/symfony/expression-language.git", - "reference": "b4a4ae33fbb33a99d23c5698faaecadb76ad0fe4" + "reference": "0877c599cb260c9614f9229c0a2090d6919fd621" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/expression-language/zipball/b4a4ae33fbb33a99d23c5698faaecadb76ad0fe4", - "reference": "b4a4ae33fbb33a99d23c5698faaecadb76ad0fe4", + "url": "https://api.github.com/repos/symfony/expression-language/zipball/0877c599cb260c9614f9229c0a2090d6919fd621", + "reference": "0877c599cb260c9614f9229c0a2090d6919fd621", "shasum": "" }, "require": { - "php": ">=8.1", - "symfony/cache": "^5.4|^6.0|^7.0", - "symfony/deprecation-contracts": "^2.5|^3", + "php": ">=8.2", + "symfony/cache": "^6.4|^7.0", "symfony/service-contracts": "^2.5|^3" }, "type": "library", @@ -9683,7 +9491,7 @@ "description": "Provides an engine that can compile and evaluate expressions", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/expression-language/tree/v6.4.3" + "source": "https://github.com/symfony/expression-language/tree/v7.0.3" }, "funding": [ { @@ -9699,7 +9507,7 @@ "type": "tidelift" } ], - "time": "2024-01-23T14:51:35+00:00" + "time": "2024-01-23T15:02:46+00:00" }, { "name": "symfony/finder", @@ -9767,28 +9575,27 @@ }, { "name": "symfony/http-client", - "version": "v6.4.3", + "version": "v7.0.3", "source": { "type": "git", "url": "https://github.com/symfony/http-client.git", - "reference": "a9034bc119fab8238f76cf49c770f3135f3ead86" + "reference": "3d2605c07cd14aec294f72f5bf8147702f7a5ada" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-client/zipball/a9034bc119fab8238f76cf49c770f3135f3ead86", - "reference": "a9034bc119fab8238f76cf49c770f3135f3ead86", + "url": "https://api.github.com/repos/symfony/http-client/zipball/3d2605c07cd14aec294f72f5bf8147702f7a5ada", + "reference": "3d2605c07cd14aec294f72f5bf8147702f7a5ada", "shasum": "" }, "require": { - "php": ">=8.1", + "php": ">=8.2", "psr/log": "^1|^2|^3", - "symfony/deprecation-contracts": "^2.5|^3", "symfony/http-client-contracts": "^3", "symfony/service-contracts": "^2.5|^3" }, "conflict": { "php-http/discovery": "<1.15", - "symfony/http-foundation": "<6.3" + "symfony/http-foundation": "<6.4" }, "provide": { "php-http/async-client-implementation": "*", @@ -9805,11 +9612,11 @@ "nyholm/psr7": "^1.0", "php-http/httplug": "^1.0|^2.0", "psr/http-client": "^1.0", - "symfony/dependency-injection": "^5.4|^6.0|^7.0", - "symfony/http-kernel": "^5.4|^6.0|^7.0", - "symfony/messenger": "^5.4|^6.0|^7.0", - "symfony/process": "^5.4|^6.0|^7.0", - "symfony/stopwatch": "^5.4|^6.0|^7.0" + "symfony/dependency-injection": "^6.4|^7.0", + "symfony/http-kernel": "^6.4|^7.0", + "symfony/messenger": "^6.4|^7.0", + "symfony/process": "^6.4|^7.0", + "symfony/stopwatch": "^6.4|^7.0" }, "type": "library", "autoload": { @@ -9840,7 +9647,7 @@ "http" ], "support": { - "source": "https://github.com/symfony/http-client/tree/v6.4.3" + "source": "https://github.com/symfony/http-client/tree/v7.0.3" }, "funding": [ { @@ -9856,7 +9663,7 @@ "type": "tidelift" } ], - "time": "2024-01-29T15:01:07+00:00" + "time": "2024-01-29T15:41:16+00:00" }, { "name": "symfony/http-client-contracts", @@ -10208,28 +10015,28 @@ }, { "name": "symfony/mailgun-mailer", - "version": "v6.4.3", + "version": "v7.0.3", "source": { "type": "git", "url": "https://github.com/symfony/mailgun-mailer.git", - "reference": "96d23bb0e773ecfc3fb8d21cdabfbb3f4d6abf04" + "reference": "fa7d03eb374938cb1f7a04c17a11a0e969e38cb8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/mailgun-mailer/zipball/96d23bb0e773ecfc3fb8d21cdabfbb3f4d6abf04", - "reference": "96d23bb0e773ecfc3fb8d21cdabfbb3f4d6abf04", + "url": "https://api.github.com/repos/symfony/mailgun-mailer/zipball/fa7d03eb374938cb1f7a04c17a11a0e969e38cb8", + "reference": "fa7d03eb374938cb1f7a04c17a11a0e969e38cb8", "shasum": "" }, "require": { - "php": ">=8.1", - "symfony/mailer": "^5.4.21|^6.2.7|^7.0" + "php": ">=8.2", + "symfony/mailer": "^6.4|^7.0" }, "conflict": { - "symfony/http-foundation": "<6.2" + "symfony/http-foundation": "<6.4" }, "require-dev": { - "symfony/http-client": "^6.3|^7.0", - "symfony/webhook": "^6.3|^7.0" + "symfony/http-client": "^6.4|^7.0", + "symfony/webhook": "^6.4|^7.0" }, "type": "symfony-mailer-bridge", "autoload": { @@ -10257,7 +10064,7 @@ "description": "Symfony Mailgun Mailer Bridge", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/mailgun-mailer/tree/v6.4.3" + "source": "https://github.com/symfony/mailgun-mailer/tree/v7.0.3" }, "funding": [ { @@ -10273,7 +10080,7 @@ "type": "tidelift" } ], - "time": "2024-01-29T15:01:07+00:00" + "time": "2024-01-29T15:41:16+00:00" }, { "name": "symfony/mime", @@ -10428,16 +10235,16 @@ }, { "name": "symfony/polyfill-ctype", - "version": "v1.28.0", + "version": "v1.29.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb" + "reference": "ef4d7e442ca910c4764bce785146269b30cb5fc4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb", - "reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/ef4d7e442ca910c4764bce785146269b30cb5fc4", + "reference": "ef4d7e442ca910c4764bce785146269b30cb5fc4", "shasum": "" }, "require": { @@ -10451,9 +10258,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -10490,7 +10294,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.28.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.29.0" }, "funding": [ { @@ -10506,20 +10310,20 @@ "type": "tidelift" } ], - "time": "2023-01-26T09:26:14+00:00" + "time": "2024-01-29T20:11:03+00:00" }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.28.0", + "version": "v1.29.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "875e90aeea2777b6f135677f618529449334a612" + "reference": "32a9da87d7b3245e09ac426c83d334ae9f06f80f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/875e90aeea2777b6f135677f618529449334a612", - "reference": "875e90aeea2777b6f135677f618529449334a612", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/32a9da87d7b3245e09ac426c83d334ae9f06f80f", + "reference": "32a9da87d7b3245e09ac426c83d334ae9f06f80f", "shasum": "" }, "require": { @@ -10530,9 +10334,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -10571,7 +10372,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.28.0" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.29.0" }, "funding": [ { @@ -10587,20 +10388,20 @@ "type": "tidelift" } ], - "time": "2023-01-26T09:26:14+00:00" + "time": "2024-01-29T20:11:03+00:00" }, { "name": "symfony/polyfill-intl-idn", - "version": "v1.28.0", + "version": "v1.29.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-idn.git", - "reference": "ecaafce9f77234a6a449d29e49267ba10499116d" + "reference": "a287ed7475f85bf6f61890146edbc932c0fff919" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/ecaafce9f77234a6a449d29e49267ba10499116d", - "reference": "ecaafce9f77234a6a449d29e49267ba10499116d", + "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/a287ed7475f85bf6f61890146edbc932c0fff919", + "reference": "a287ed7475f85bf6f61890146edbc932c0fff919", "shasum": "" }, "require": { @@ -10613,9 +10414,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -10658,7 +10456,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.28.0" + "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.29.0" }, "funding": [ { @@ -10674,20 +10472,20 @@ "type": "tidelift" } ], - "time": "2023-01-26T09:30:37+00:00" + "time": "2024-01-29T20:11:03+00:00" }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.28.0", + "version": "v1.29.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92" + "reference": "bc45c394692b948b4d383a08d7753968bed9a83d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92", - "reference": "8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/bc45c394692b948b4d383a08d7753968bed9a83d", + "reference": "bc45c394692b948b4d383a08d7753968bed9a83d", "shasum": "" }, "require": { @@ -10698,9 +10496,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -10742,7 +10537,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.28.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.29.0" }, "funding": [ { @@ -10758,20 +10553,20 @@ "type": "tidelift" } ], - "time": "2023-01-26T09:26:14+00:00" + "time": "2024-01-29T20:11:03+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.28.0", + "version": "v1.29.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "42292d99c55abe617799667f454222c54c60e229" + "reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/42292d99c55abe617799667f454222c54c60e229", - "reference": "42292d99c55abe617799667f454222c54c60e229", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9773676c8a1bb1f8d4340a62efe641cf76eda7ec", + "reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec", "shasum": "" }, "require": { @@ -10785,9 +10580,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -10825,7 +10617,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.28.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.29.0" }, "funding": [ { @@ -10841,20 +10633,20 @@ "type": "tidelift" } ], - "time": "2023-07-28T09:04:16+00:00" + "time": "2024-01-29T20:11:03+00:00" }, { "name": "symfony/polyfill-php72", - "version": "v1.28.0", + "version": "v1.29.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php72.git", - "reference": "70f4aebd92afca2f865444d30a4d2151c13c3179" + "reference": "861391a8da9a04cbad2d232ddd9e4893220d6e25" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/70f4aebd92afca2f865444d30a4d2151c13c3179", - "reference": "70f4aebd92afca2f865444d30a4d2151c13c3179", + "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/861391a8da9a04cbad2d232ddd9e4893220d6e25", + "reference": "861391a8da9a04cbad2d232ddd9e4893220d6e25", "shasum": "" }, "require": { @@ -10862,9 +10654,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -10901,7 +10690,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php72/tree/v1.28.0" + "source": "https://github.com/symfony/polyfill-php72/tree/v1.29.0" }, "funding": [ { @@ -10917,20 +10706,20 @@ "type": "tidelift" } ], - "time": "2023-01-26T09:26:14+00:00" + "time": "2024-01-29T20:11:03+00:00" }, { "name": "symfony/polyfill-php80", - "version": "v1.28.0", + "version": "v1.29.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5" + "reference": "87b68208d5c1188808dd7839ee1e6c8ec3b02f1b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/6caa57379c4aec19c0a12a38b59b26487dcfe4b5", - "reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/87b68208d5c1188808dd7839ee1e6c8ec3b02f1b", + "reference": "87b68208d5c1188808dd7839ee1e6c8ec3b02f1b", "shasum": "" }, "require": { @@ -10938,9 +10727,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -10984,7 +10770,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.28.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.29.0" }, "funding": [ { @@ -11000,20 +10786,20 @@ "type": "tidelift" } ], - "time": "2023-01-26T09:26:14+00:00" + "time": "2024-01-29T20:11:03+00:00" }, { "name": "symfony/polyfill-php83", - "version": "v1.28.0", + "version": "v1.29.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php83.git", - "reference": "b0f46ebbeeeda3e9d2faebdfbf4b4eae9b59fa11" + "reference": "86fcae159633351e5fd145d1c47de6c528f8caff" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php83/zipball/b0f46ebbeeeda3e9d2faebdfbf4b4eae9b59fa11", - "reference": "b0f46ebbeeeda3e9d2faebdfbf4b4eae9b59fa11", + "url": "https://api.github.com/repos/symfony/polyfill-php83/zipball/86fcae159633351e5fd145d1c47de6c528f8caff", + "reference": "86fcae159633351e5fd145d1c47de6c528f8caff", "shasum": "" }, "require": { @@ -11022,9 +10808,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -11064,7 +10847,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php83/tree/v1.28.0" + "source": "https://github.com/symfony/polyfill-php83/tree/v1.29.0" }, "funding": [ { @@ -11080,20 +10863,20 @@ "type": "tidelift" } ], - "time": "2023-08-16T06:22:46+00:00" + "time": "2024-01-29T20:11:03+00:00" }, { "name": "symfony/polyfill-uuid", - "version": "v1.28.0", + "version": "v1.29.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-uuid.git", - "reference": "9c44518a5aff8da565c8a55dbe85d2769e6f630e" + "reference": "3abdd21b0ceaa3000ee950097bc3cf9efc137853" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-uuid/zipball/9c44518a5aff8da565c8a55dbe85d2769e6f630e", - "reference": "9c44518a5aff8da565c8a55dbe85d2769e6f630e", + "url": "https://api.github.com/repos/symfony/polyfill-uuid/zipball/3abdd21b0ceaa3000ee950097bc3cf9efc137853", + "reference": "3abdd21b0ceaa3000ee950097bc3cf9efc137853", "shasum": "" }, "require": { @@ -11107,9 +10890,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -11146,7 +10926,7 @@ "uuid" ], "support": { - "source": "https://github.com/symfony/polyfill-uuid/tree/v1.28.0" + "source": "https://github.com/symfony/polyfill-uuid/tree/v1.29.0" }, "funding": [ { @@ -11162,7 +10942,7 @@ "type": "tidelift" } ], - "time": "2023-01-26T09:26:14+00:00" + "time": "2024-01-29T20:11:03+00:00" }, { "name": "symfony/process", @@ -12451,16 +12231,16 @@ }, { "name": "weble/zohoclient", - "version": "4.2.1", + "version": "4.2.2", "source": { "type": "git", "url": "https://github.com/Weble/ZohoClient.git", - "reference": "0f1dc5909e5264d036f23be070893a94919b656a" + "reference": "88c1689d8ecc46413685488a5669bccc2fd784f6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Weble/ZohoClient/zipball/0f1dc5909e5264d036f23be070893a94919b656a", - "reference": "0f1dc5909e5264d036f23be070893a94919b656a", + "url": "https://api.github.com/repos/Weble/ZohoClient/zipball/88c1689d8ecc46413685488a5669bccc2fd784f6", + "reference": "88c1689d8ecc46413685488a5669bccc2fd784f6", "shasum": "" }, "require": { @@ -12498,7 +12278,7 @@ ], "support": { "issues": "https://github.com/Weble/ZohoClient/issues", - "source": "https://github.com/Weble/ZohoClient/tree/4.2.1" + "source": "https://github.com/Weble/ZohoClient/tree/4.2.2" }, "funding": [ { @@ -12506,7 +12286,7 @@ "type": "github" } ], - "time": "2022-05-26T06:59:53+00:00" + "time": "2024-02-07T17:00:38+00:00" }, { "name": "webleit/zohocrmapi", @@ -13360,16 +13140,16 @@ }, { "name": "fidry/cpu-core-counter", - "version": "1.0.0", + "version": "1.1.0", "source": { "type": "git", "url": "https://github.com/theofidry/cpu-core-counter.git", - "reference": "85193c0b0cb5c47894b5eaec906e946f054e7077" + "reference": "f92996c4d5c1a696a6a970e20f7c4216200fcc42" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/theofidry/cpu-core-counter/zipball/85193c0b0cb5c47894b5eaec906e946f054e7077", - "reference": "85193c0b0cb5c47894b5eaec906e946f054e7077", + "url": "https://api.github.com/repos/theofidry/cpu-core-counter/zipball/f92996c4d5c1a696a6a970e20f7c4216200fcc42", + "reference": "f92996c4d5c1a696a6a970e20f7c4216200fcc42", "shasum": "" }, "require": { @@ -13409,7 +13189,7 @@ ], "support": { "issues": "https://github.com/theofidry/cpu-core-counter/issues", - "source": "https://github.com/theofidry/cpu-core-counter/tree/1.0.0" + "source": "https://github.com/theofidry/cpu-core-counter/tree/1.1.0" }, "funding": [ { @@ -13417,7 +13197,7 @@ "type": "github" } ], - "time": "2023-09-17T21:38:23+00:00" + "time": "2024-02-07T09:43:46+00:00" }, { "name": "filp/whoops", @@ -14138,16 +13918,16 @@ }, { "name": "phpstan/phpstan", - "version": "1.10.57", + "version": "1.10.58", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "1627b1d03446904aaa77593f370c5201d2ecc34e" + "reference": "a23518379ec4defd9e47cbf81019526861623ec2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/1627b1d03446904aaa77593f370c5201d2ecc34e", - "reference": "1627b1d03446904aaa77593f370c5201d2ecc34e", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/a23518379ec4defd9e47cbf81019526861623ec2", + "reference": "a23518379ec4defd9e47cbf81019526861623ec2", "shasum": "" }, "require": { @@ -14196,7 +13976,7 @@ "type": "tidelift" } ], - "time": "2024-01-24T11:51:34+00:00" + "time": "2024-02-12T20:02:57+00:00" }, { "name": "phpunit/php-code-coverage", @@ -15537,16 +15317,16 @@ }, { "name": "spatie/array-to-xml", - "version": "3.2.2", + "version": "3.2.3", "source": { "type": "git", "url": "https://github.com/spatie/array-to-xml.git", - "reference": "96be97e664c87613121d073ea39af4c74e57a7f8" + "reference": "c95fd4db94ec199f798d4b5b4a81757bd20d88ab" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/array-to-xml/zipball/96be97e664c87613121d073ea39af4c74e57a7f8", - "reference": "96be97e664c87613121d073ea39af4c74e57a7f8", + "url": "https://api.github.com/repos/spatie/array-to-xml/zipball/c95fd4db94ec199f798d4b5b4a81757bd20d88ab", + "reference": "c95fd4db94ec199f798d4b5b4a81757bd20d88ab", "shasum": "" }, "require": { @@ -15584,7 +15364,7 @@ "xml" ], "support": { - "source": "https://github.com/spatie/array-to-xml/tree/3.2.2" + "source": "https://github.com/spatie/array-to-xml/tree/3.2.3" }, "funding": [ { @@ -15596,7 +15376,7 @@ "type": "github" } ], - "time": "2023-11-14T14:08:51+00:00" + "time": "2024-02-07T10:39:02+00:00" }, { "name": "spatie/backtrace", @@ -15814,16 +15594,16 @@ }, { "name": "spatie/laravel-ignition", - "version": "2.4.1", + "version": "2.4.2", "source": { "type": "git", "url": "https://github.com/spatie/laravel-ignition.git", - "reference": "005e1e7b1232f3b22d7e7be3f602693efc7dba67" + "reference": "351504f4570e32908839fc5a2dc53bf77d02f85e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/laravel-ignition/zipball/005e1e7b1232f3b22d7e7be3f602693efc7dba67", - "reference": "005e1e7b1232f3b22d7e7be3f602693efc7dba67", + "url": "https://api.github.com/repos/spatie/laravel-ignition/zipball/351504f4570e32908839fc5a2dc53bf77d02f85e", + "reference": "351504f4570e32908839fc5a2dc53bf77d02f85e", "shasum": "" }, "require": { @@ -15902,7 +15682,7 @@ "type": "github" } ], - "time": "2024-01-12T13:14:58+00:00" + "time": "2024-02-09T16:08:40+00:00" }, { "name": "symfony/filesystem", diff --git a/config/database.php b/config/database.php index 62e7f4c3a..8901f10e7 100644 --- a/config/database.php +++ b/config/database.php @@ -56,7 +56,7 @@ 'collation' => 'utf8mb4_unicode_520_ci', 'prefix' => '', 'prefix_indexes' => true, - 'strict' => true, + 'strict' => false, 'engine' => 'InnoDB', 'options' => extension_loaded('pdo_mysql') ? array_filter([ PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'), @@ -84,7 +84,7 @@ 'collation' => 'utf8mb4_unicode_520_ci', 'prefix' => '', 'prefix_indexes' => true, - 'strict' => true, + 'strict' => false, 'engine' => 'InnoDB', 'options' => extension_loaded('pdo_mysql') ? array_filter([ PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'), diff --git a/database/migrations/2024_02_06_054637_is_active_companies_branches.php b/database/migrations/2024_02_06_054637_is_active_companies_branches.php new file mode 100644 index 000000000..2f3f301e9 --- /dev/null +++ b/database/migrations/2024_02_06_054637_is_active_companies_branches.php @@ -0,0 +1,27 @@ +table('companies_branches', function (Blueprint $table) { + $table->boolean('is_active')->after('phone')->default(1); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('companies_branches', function (Blueprint $table) { + $table->dropColumn('is_active'); + }); + } +}; diff --git a/database/migrations/Social/2024_02_12_172534_uuid_channel.php b/database/migrations/Social/2024_02_12_172534_uuid_channel.php new file mode 100644 index 000000000..7082c3522 --- /dev/null +++ b/database/migrations/Social/2024_02_12_172534_uuid_channel.php @@ -0,0 +1,27 @@ +uuid('uuid')->after('id'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('channels', function (Blueprint $table) { + $table->dropColumn('uuid'); + }); + } +}; diff --git a/database/seeders/SystemModuleSeeder.php b/database/seeders/SystemModuleSeeder.php index d2f565943..871be5015 100755 --- a/database/seeders/SystemModuleSeeder.php +++ b/database/seeders/SystemModuleSeeder.php @@ -5,6 +5,7 @@ use Illuminate\Database\Seeder; use Illuminate\Support\Facades\DB; use Illuminate\Support\Str; +use Kanvas\Guild\Leads\Models\Lead; class SystemModuleSeeder extends Seeder { @@ -195,6 +196,24 @@ public function run() 'mobile_component_type' => null, 'mobile_navigation_type' => null, 'mobile_tab_index' => '0', + ], + [ + 'name' => 'Leads', + 'slug' => 'leads', + 'model_name' => Lead::class, + 'uuid' => (string) Str::uuid(), + 'apps_id' => '1', + 'parents_id' => '0', + 'menu_order' => null, + 'show' => '0', + 'use_elastic' => '0', + 'browse_fields' => '[{"name":"name","title":"Name","sortField":"name","filterable":true,"searchable":true},{"name":"email","title":"Email","sortField":"email","filterable":true,"searchable":true},{"name":"phone","title":"Phone","sortField":"phone","filterable":true,"searchable":true},{"name":"status","title":"Status","sortField":"status","filterable":true,"searchable":true},{"name":"created_at","title":"Created At","sortField":"created_at","filterable":true,"searchable":true}]', + 'created_at' => date('Y-m-d H:i:s'), + 'updated_at' => null, + 'is_deleted' => '0', + 'mobile_component_type' => null, + 'mobile_navigation_type' => null, + 'mobile_tab_index' => '0', ] ); } diff --git a/graphql/schemas/Ecosystem/Admin/app.graphql b/graphql/schemas/Ecosystem/Admin/app.graphql index 7f584b9ee..b23f1ec20 100644 --- a/graphql/schemas/Ecosystem/Admin/app.graphql +++ b/graphql/schemas/Ecosystem/Admin/app.graphql @@ -10,6 +10,11 @@ type App { payments_active: Boolean ecosystem_auth: Boolean is_public: Boolean! + users: [User!]! @belongsToMany + total_users: Int! + total_companies: Int! + total_system_modules: Int! @count(relation: "systemModules") + systemModules: [SystemModule!]! @belongsToMany domain_based: Boolean secrets: [AppKey]! @method(name: "getUserKeys") created_at: String! diff --git a/graphql/schemas/Ecosystem/company.graphql b/graphql/schemas/Ecosystem/company.graphql index edac02fa6..6a99b5c74 100644 --- a/graphql/schemas/Ecosystem/company.graphql +++ b/graphql/schemas/Ecosystem/company.graphql @@ -60,7 +60,11 @@ type CompanyBranch { defaultCount: 25 builder: "App\\GraphQL\\Ecosystem\\Queries\\Filesystem\\FilesystemQuery@getFileByGraphType" ) + address: String + user: User! @belongsTo(relation: "user") zipcode: Int + total_users: Int! + is_active: Boolean! is_default: Boolean! created_at: DateTime updated_at: DateTime @@ -102,6 +106,7 @@ input CompanyBranchInput { timezone: String phone: String files: [FilesystemInputUrl] + is_active: Boolean } type CompanySettings { @@ -140,6 +145,7 @@ extend type Query @guard { ) branches( + search: String @search where: _ @whereConditions( columns: [ diff --git a/graphql/schemas/Guild/lead.graphql b/graphql/schemas/Guild/lead.graphql index 8110fb9b2..6d4bce2f6 100644 --- a/graphql/schemas/Guild/lead.graphql +++ b/graphql/schemas/Guild/lead.graphql @@ -21,12 +21,13 @@ type Lead { pipeline: LeadPipeline @belongsTo stage: LeadPipelineStage @belongsTo(relation: "stage") participants: [LeadsParticipants!]! @hasMany + channels: [SocialChannel]! @hasMany files: [Filesystem!]! @paginate( defaultCount: 25 builder: "App\\GraphQL\\Ecosystem\\Queries\\Filesystem\\FilesystemQuery@getFileByGraphType" ) - followers: [User!]! + followers: [User!]! @paginate( defaultCount: 25 builder: "App\\GraphQL\\Social\\Builders\\Follows\\FollowBuilder@getEntityFollowers" @@ -180,7 +181,21 @@ extend type Query @guard { "status" ] ) - orderBy: _ @orderBy(columns: ["id", "created_at", "updated_at", "title", "status", "pipeline_stage_id", "firstname", "lastname", "email", "phone"]) + orderBy: _ + @orderBy( + columns: [ + "id" + "created_at" + "updated_at" + "title" + "status" + "pipeline_stage_id" + "firstname" + "lastname" + "email" + "phone" + ] + ) ): [Lead!]! @paginate( model: "Kanvas\\Guild\\Leads\\Models\\Lead" diff --git a/graphql/schemas/Social/channels.graphql b/graphql/schemas/Social/channels.graphql index 6e6534365..3fbce1a82 100644 --- a/graphql/schemas/Social/channels.graphql +++ b/graphql/schemas/Social/channels.graphql @@ -5,6 +5,7 @@ extend type User { type SocialChannel { id: ID! name: String! + uuid: String slug: String description: String! entity_namespace: String! diff --git a/graphql/schemas/Social/message.graphql b/graphql/schemas/Social/message.graphql index f226b2577..05d5fc3c6 100644 --- a/graphql/schemas/Social/message.graphql +++ b/graphql/schemas/Social/message.graphql @@ -109,4 +109,30 @@ extend type Query @guard { builder: "App\\GraphQL\\Social\\Builders\\Messages\\MessageBuilder@getAll" scopes: ["fromApp"] ) + + channelMessages( + channel_uuid: String! + where: _ + @whereConditions( + columns: [ + "id" + "parent_id" + "parent_unique_id" + "companies_id" + "uuid" + "message_types_id" + "message" + "reactions_count" + "comments_count" + "total_liked" + "total_saved" + "total_shared" + ] + ) + ): [Message!]! + @paginate( + defaultCount: 25 + builder: "App\\GraphQL\\Social\\Builders\\Messages\\MessageBuilder@getChannelMessages" + scopes: ["fromApp"] + ) } diff --git a/src/Domains/Connectors/Zoho/Enums/CustomFieldEnum.php b/src/Domains/Connectors/Zoho/Enums/CustomFieldEnum.php index 6ad6619bc..bfc99198c 100644 --- a/src/Domains/Connectors/Zoho/Enums/CustomFieldEnum.php +++ b/src/Domains/Connectors/Zoho/Enums/CustomFieldEnum.php @@ -12,6 +12,7 @@ enum CustomFieldEnum: string case ZOHO_LEAD_ID = 'ZOHO_LEAD_ID'; case DEFAULT_OWNER = 'ZOHO_DEFAULT_OWNER'; case ZOHO_DEFAULT_LEAD_SOURCE = 'ZOHO_DEFAULT_LEAD_SOURCE'; + case ZOHO_USE_AGENT_NAME = 'ZOHO_USE_AGENT_NAME'; case FIELDS_MAP = 'ZOHO_FIELDS_MAP'; case ZOHO_MEMBER_FIELD = 'ZOHO_MEMBER_FIELD'; case ZOHO_USER_OWNER_ID = 'ZOHO_USER_OWNER_ID'; diff --git a/src/Domains/Connectors/Zoho/Workflows/ZohoLeadActivity.php b/src/Domains/Connectors/Zoho/Workflows/ZohoLeadActivity.php index 35d9019cd..c1162c85b 100644 --- a/src/Domains/Connectors/Zoho/Workflows/ZohoLeadActivity.php +++ b/src/Domains/Connectors/Zoho/Workflows/ZohoLeadActivity.php @@ -99,7 +99,7 @@ protected function assignAgent( $defaultLeadSource = $company->get(CustomFieldEnum::ZOHO_DEFAULT_LEAD_SOURCE->value); if (! empty($defaultLeadSource)) { - $zohoData['Lead_Source'] = $defaultLeadSource; + $zohoData['Lead_Source'] = $lead->receiver ? $lead->receiver->name : $defaultLeadSource; } if ($agent && $agent->count()) { @@ -119,14 +119,18 @@ protected function assignAgent( } } elseif ($agentInfo) { $zohoData['Owner'] = (int) $agentInfo->owner_linked_source_id; - $zohoData['Lead_Source'] = $agentInfo->name; + if (empty($defaultLeadSource)) { + $zohoData['Lead_Source'] = $agentInfo->name; + } if ($agentInfo->user && $agentInfo->user->get('sponsor')) { $zohoData['Sponsor'] = (string) $agent->user->get('sponsor'); } } - + if ($company->get(CustomFieldEnum::ZOHO_USE_AGENT_NAME->value)) { + $zohoData['Agent_Name'] = $agentInfo->name; + } //if value is 0 or empty, remove it if (empty($zohoData['Owner'])) { diff --git a/src/Domains/Connectors/Zoho/ZohoService.php b/src/Domains/Connectors/Zoho/ZohoService.php index 2be49ca44..92897acc8 100644 --- a/src/Domains/Connectors/Zoho/ZohoService.php +++ b/src/Domains/Connectors/Zoho/ZohoService.php @@ -10,6 +10,7 @@ use Exception; use Kanvas\Connectors\Zoho\Enums\CustomFieldEnum; use Kanvas\Guild\Agents\Models\Agent; +use Kanvas\Guild\Leads\Models\Lead; use Webleit\ZohoCrmApi\ZohoCrm; class ZohoService @@ -78,4 +79,22 @@ public function createAgent(UserInterface $user, Agent $agentInfo, ?object $zoho return $zohoAgent; } + + public function deleteLead(Lead $lead): void + { + $zohoLeadId = $lead->get(CustomFieldEnum::ZOHO_LEAD_ID->value); + if ($zohoLeadId) { + $this->zohoCrm->leads->delete((string) $zohoLeadId); + } + } + + public function deleteAgent(Agent $agent): void + { + $zohoAgentId = $agent->users_linked_source_id; + if ($this->zohoAgentModule == self::DEFAULT_AGENT_MODULE) { + $this->zohoCrm->agents->delete($zohoAgentId); + } else { + $this->zohoCrm->vendors->delete($zohoAgentId); + } + } } diff --git a/src/Domains/Guild/Agents/Models/Agent.php b/src/Domains/Guild/Agents/Models/Agent.php index 08d177874..10d074ec2 100644 --- a/src/Domains/Guild/Agents/Models/Agent.php +++ b/src/Domains/Guild/Agents/Models/Agent.php @@ -55,7 +55,7 @@ public function status(): Attribute ); } - public static function getByMemberNumber(string $memberNumber, CompanyInterface $company): self + public static function getByMemberNumber(string|int $memberNumber, CompanyInterface $company): self { return self::where('member_id', $memberNumber) ->fromCompany($company) diff --git a/src/Domains/Guild/Leads/Models/Lead.php b/src/Domains/Guild/Leads/Models/Lead.php index 1ad08e724..9a0e209f0 100644 --- a/src/Domains/Guild/Leads/Models/Lead.php +++ b/src/Domains/Guild/Leads/Models/Lead.php @@ -10,6 +10,7 @@ use Baka\Users\Contracts\UserInterface; use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Relations\BelongsTo; +use Illuminate\Database\Eloquent\Relations\HasMany; use Illuminate\Database\Eloquent\Relations\HasManyThrough; use Kanvas\Apps\Models\Apps; use Kanvas\Guild\Customers\Models\People; @@ -19,6 +20,7 @@ use Kanvas\Guild\Organizations\Models\Organization; use Kanvas\Guild\Pipelines\Models\Pipeline; use Kanvas\Guild\Pipelines\Models\PipelineStage; +use Kanvas\Social\Channels\Models\Channel; use Kanvas\Social\Follows\Traits\FollowersTrait; use Kanvas\Users\Models\Users; use Kanvas\Workflow\Traits\CanUseWorkflow; @@ -105,6 +107,11 @@ public function owner(): BelongsTo return $this->belongsTo(Users::class, 'leads_owner_id', 'id'); } + public function socialChannels(): HasMany + { + return $this->hasMany(Channel::class, 'entity_id', 'id')->where('entity_namespace', self::class); + } + public function receiver(): BelongsTo { return $this->belongsTo(LeadReceiver::class, 'leads_receivers_id', 'id'); diff --git a/src/Domains/Guild/Leads/Observers/LeadObserver.php b/src/Domains/Guild/Leads/Observers/LeadObserver.php index ba3cbd810..a7b29bf01 100644 --- a/src/Domains/Guild/Leads/Observers/LeadObserver.php +++ b/src/Domains/Guild/Leads/Observers/LeadObserver.php @@ -5,11 +5,14 @@ namespace Kanvas\Guild\Leads\Observers; use Baka\Support\Str; +use Kanvas\Apps\Models\Apps; use Kanvas\Guild\Customers\Repositories\PeoplesRepository; use Kanvas\Guild\Leads\Models\Lead; use Kanvas\Guild\Leads\Models\LeadReceiver; use Kanvas\Guild\Leads\Models\LeadStatus; use Kanvas\Guild\Pipelines\Models\Pipeline; +use Kanvas\Social\Channels\Actions\CreateChannelAction; +use Kanvas\Social\Channels\DataTransferObject\Channel; use Kanvas\Workflow\Enums\WorkflowEnum; class LeadObserver @@ -64,6 +67,22 @@ public function creating(Lead $lead): void public function created(Lead $lead): void { $lead->fireWorkflow(WorkflowEnum::CREATED->value); + if ($lead->user) { + ( + new CreateChannelAction( + new Channel( + app(Apps::class), + $lead->company, + $lead->user, + (string)$lead->id, + Lead::class, + 'Default Channel', + $lead->description ?? '', + $lead->uuid->toString() + ) + ) + )->execute(); + } } public function updated(Lead $lead): void diff --git a/src/Domains/Social/Channels/Actions/CreateChannelAction.php b/src/Domains/Social/Channels/Actions/CreateChannelAction.php index dbbf2909c..539e5bc76 100644 --- a/src/Domains/Social/Channels/Actions/CreateChannelAction.php +++ b/src/Domains/Social/Channels/Actions/CreateChannelAction.php @@ -21,7 +21,7 @@ public function execute(): Channel 'apps_id' => $this->channelDto->apps->id, 'companies_id' => $this->channelDto->companies->id, 'name' => $this->channelDto->name, - 'slug' => Str::slug($this->channelDto->name), + 'slug' => $this->channelDto->slug ?? Str::slug($this->channelDto->name), 'description' => $this->channelDto->description, 'entity_id' => $this->channelDto->entity_id, 'entity_namespace' => $this->channelDto->entity_namespace, diff --git a/src/Domains/Social/Channels/DataTransferObject/Channel.php b/src/Domains/Social/Channels/DataTransferObject/Channel.php index 47216521d..cb3455e5b 100644 --- a/src/Domains/Social/Channels/DataTransferObject/Channel.php +++ b/src/Domains/Social/Channels/DataTransferObject/Channel.php @@ -19,6 +19,7 @@ public function __construct( public string $entity_namespace, public string $name = '', public string $description = '', + public ?string $slug = null ) { } } diff --git a/src/Domains/Social/Channels/Models/Channel.php b/src/Domains/Social/Channels/Models/Channel.php index 8f5066e7b..b1a49be63 100644 --- a/src/Domains/Social/Channels/Models/Channel.php +++ b/src/Domains/Social/Channels/Models/Channel.php @@ -4,6 +4,7 @@ namespace Kanvas\Social\Channels\Models; +use Baka\Traits\UuidTrait; use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\Relations\BelongsToMany; use Kanvas\Social\Messages\Models\Message; @@ -24,6 +25,8 @@ */ class Channel extends BaseModel { + use UuidTrait; + protected $table = 'channels'; protected $guarded = []; diff --git a/src/Domains/Social/Messages/Models/Message.php b/src/Domains/Social/Messages/Models/Message.php index 42e078901..35d5119b7 100644 --- a/src/Domains/Social/Messages/Models/Message.php +++ b/src/Domains/Social/Messages/Models/Message.php @@ -13,6 +13,7 @@ use Illuminate\Database\Eloquent\Relations\HasMany; use Illuminate\Database\Eloquent\Relations\HasOne; use Kanvas\Apps\Models\Apps; +use Kanvas\Social\Channels\Models\Channel; use Kanvas\Social\Messages\Factories\MessageFactory; use Kanvas\Social\MessagesComments\Models\MessageComment; use Kanvas\Social\MessagesTypes\Models\MessageType; @@ -85,6 +86,14 @@ public function topics(): BelongsToMany ->where('entity_namespace', self::class); } + /** + * The roles that belong to the Message + */ + public function channels(): BelongsToMany + { + return $this->belongsToMany(Channel::class, 'channel_messages', 'messages_id', 'channel_id'); + } + /** * messageType */ diff --git a/src/Kanvas/Apps/Models/Apps.php b/src/Kanvas/Apps/Models/Apps.php index d02ebe50e..23cd150e8 100644 --- a/src/Kanvas/Apps/Models/Apps.php +++ b/src/Kanvas/Apps/Models/Apps.php @@ -13,6 +13,7 @@ use Illuminate\Contracts\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Collection; use Illuminate\Database\Eloquent\ModelNotFoundException; +use Illuminate\Database\Eloquent\Relations\BelongsToMany; use Illuminate\Database\Eloquent\Relations\HasMany; use Illuminate\Database\Eloquent\Relations\HasManyThrough; use Illuminate\Support\Facades\Auth; @@ -97,6 +98,11 @@ public function companies(): HasManyThrough ); } + public function users(): BelongsToMany + { + return $this->belongsToMany(Users::class, 'users_associated_apps', 'apps_id', 'users_id'); + } + public function keys(): HasMany { return $this->hasMany(AppKey::class, 'apps_id'); diff --git a/src/Kanvas/Companies/Actions/DeleteCompaniesAction.php b/src/Kanvas/Companies/Actions/DeleteCompaniesAction.php index 3ffb0bc84..51a843a51 100644 --- a/src/Kanvas/Companies/Actions/DeleteCompaniesAction.php +++ b/src/Kanvas/Companies/Actions/DeleteCompaniesAction.php @@ -36,7 +36,7 @@ public function execute(int $id): bool { $companies = Companies::getById($id); - if (! $companies->isOwner($this->user)) { + if (! $companies->isOwner($this->user) && ! $this->user->isAdmin()) { throw new AuthorizationException('User cant delete this company'); } diff --git a/src/Kanvas/Companies/Branches/Actions/CreateCompanyBranchActions.php b/src/Kanvas/Companies/Branches/Actions/CreateCompanyBranchActions.php index 064f257f4..fda46ae5d 100644 --- a/src/Kanvas/Companies/Branches/Actions/CreateCompanyBranchActions.php +++ b/src/Kanvas/Companies/Branches/Actions/CreateCompanyBranchActions.php @@ -47,6 +47,7 @@ public function execute(): CompaniesBranches $companyBranch->email = $this->data->email; $companyBranch->phone = $this->data->phone; $companyBranch->zipcode = $this->data->zipcode; + $companyBranch->is_active = $this->data->is_active; $company->branches()->save($companyBranch); diff --git a/src/Kanvas/Companies/Branches/Actions/UpdateCompanyBranchActions.php b/src/Kanvas/Companies/Branches/Actions/UpdateCompanyBranchActions.php index 6422482b8..4c1de57b3 100644 --- a/src/Kanvas/Companies/Branches/Actions/UpdateCompanyBranchActions.php +++ b/src/Kanvas/Companies/Branches/Actions/UpdateCompanyBranchActions.php @@ -44,6 +44,7 @@ public function execute(int $companyBranchId): CompaniesBranches $companyBranch->email = $this->data->email; $companyBranch->phone = $this->data->phone; $companyBranch->zipcode = $this->data->zipcode; + $companyBranch->is_active = $this->data->is_active; $companyBranch->updateOrFail(); if ($this->data->files) { diff --git a/src/Kanvas/Companies/Branches/DataTransferObject/CompaniesBranchPostData.php b/src/Kanvas/Companies/Branches/DataTransferObject/CompaniesBranchPostData.php index d08ff4fb5..008ae9175 100644 --- a/src/Kanvas/Companies/Branches/DataTransferObject/CompaniesBranchPostData.php +++ b/src/Kanvas/Companies/Branches/DataTransferObject/CompaniesBranchPostData.php @@ -16,15 +16,14 @@ class CompaniesBranchPostData extends Data /** * Construct function. * - * @param string $name * @param int|null $users_id - * @param array|null $files */ public function __construct( public string $name, public int $companies_id, public int $users_id, public int $is_default = 0, + public bool $is_active = true, public ?string $email = null, public ?string $address = null, public ?string $phone = null, @@ -37,8 +36,6 @@ public function __construct( * Create new instance of DTO from request. * * @param Request $request Request Input data - * - * @return self */ public static function viaRequest(Request $request): self { @@ -49,6 +46,7 @@ public static function viaRequest(Request $request): self is_default: (int) $request->get('is_default'), email : $request->get('email'), files : $request->get('files'), + is_active: $data['is_active'] ?? true ); } @@ -56,8 +54,6 @@ public static function viaRequest(Request $request): self * Create new instance of DTO from array of data. * * @param array $data Input data - * - * @return self */ public static function fromArray(array $data): self { @@ -69,7 +65,8 @@ public static function fromArray(array $data): self email : $data['email'] ?? null, phone : $data['phone'] ?? null, zipcode : $data['zipcode'] ?? null, - files: $data['files'] ?? null + files: $data['files'] ?? null, + is_active: $data['is_active'] ?? true ); } } diff --git a/src/Kanvas/Companies/Branches/DataTransferObject/CompaniesBranchPutData.php b/src/Kanvas/Companies/Branches/DataTransferObject/CompaniesBranchPutData.php index ee4da18b8..c5390a1ed 100644 --- a/src/Kanvas/Companies/Branches/DataTransferObject/CompaniesBranchPutData.php +++ b/src/Kanvas/Companies/Branches/DataTransferObject/CompaniesBranchPutData.php @@ -15,14 +15,13 @@ class CompaniesBranchPutData extends Data /** * Construct function. * - * @param string $name * @param int|null $users_id - * @param array|null $files */ public function __construct( public string $name, public int $companies_id, public int $is_default = 0, + public bool $is_active = true, public ?string $email = null, public ?string $address = null, public ?string $phone = null, @@ -35,8 +34,6 @@ public function __construct( * Create new instance of DTO from request. * * @param Request $request Request Input data - * - * @return self */ public static function viaRequest(Request $request): self { @@ -53,8 +50,6 @@ public static function viaRequest(Request $request): self * Create new instance of DTO from array of data. * * @param array $data Input data - * - * @return self */ public static function fromArray(array $data): self { diff --git a/src/Kanvas/Companies/Jobs/DeleteCompanyJob.php b/src/Kanvas/Companies/Jobs/DeleteCompanyJob.php new file mode 100644 index 000000000..0e7f46b8d --- /dev/null +++ b/src/Kanvas/Companies/Jobs/DeleteCompanyJob.php @@ -0,0 +1,33 @@ +user); + $companyDelete->execute($this->companiesId); + } +} diff --git a/src/Kanvas/Companies/Models/CompaniesBranches.php b/src/Kanvas/Companies/Models/CompaniesBranches.php index 6021a1b16..7082fda28 100644 --- a/src/Kanvas/Companies/Models/CompaniesBranches.php +++ b/src/Kanvas/Companies/Models/CompaniesBranches.php @@ -7,12 +7,19 @@ use Baka\Traits\UuidTrait; use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Relations\BelongsTo; +use Illuminate\Database\Eloquent\Relations\HasManyThrough; use Illuminate\Support\Facades\Auth; +use Kanvas\Apps\Models\Apps; use Kanvas\Companies\Branches\Factories\CompaniesBranchesFactory; +use Kanvas\Companies\Enums\Defaults; +use Kanvas\CustomFields\Traits\HasCustomFields; +use Kanvas\Enums\StateEnums; use Kanvas\Filesystem\Models\FilesystemEntities; use Kanvas\Filesystem\Traits\HasFilesystemTrait; use Kanvas\Models\BaseModel; +use Kanvas\Traits\SearchableDynamicIndexTrait; use Kanvas\Users\Models\Users; +use Kanvas\Users\Models\UsersAssociatedCompanies; /** * Companies Model. @@ -30,6 +37,8 @@ class CompaniesBranches extends BaseModel { use UuidTrait; use HasFilesystemTrait; + use SearchableDynamicIndexTrait; + use HasCustomFields; /** * The table associated with the model. @@ -72,6 +81,25 @@ public function isDefault(): bool return (bool) $this->is_default; } + public function getTotalUsersAttribute(): int + { + if (! $this->get('total_users')) { + $this->set('total_users', $this->users()->count()); + } + + return $this->get('total_users'); + } + + public static function searchableIndex(): string + { + return Defaults::SEARCHABLE_INDEX->getValue(); + } + + public function shouldBeSearchable(): bool + { + return $this->is_deleted === StateEnums::NO->getValue(); + } + /** * Filter what the user can see. */ @@ -81,12 +109,30 @@ public function scopeUserAssociated(Builder $query): Builder return $query->join('users_associated_company', function ($join) use ($user) { $join->on('users_associated_company.companies_id', '=', 'companies_branches.companies_id') - ->where('users_associated_company.users_id', '=', $user->getKey()) ->where('users_associated_company.is_deleted', '=', 0); }) + ->join('users_associated_apps', function ($join) { + $join->on('users_associated_apps.companies_id', '=', 'companies_branches.companies_id') + ->where('users_associated_apps.apps_id', app(Apps::class)->getId()); + }) + ->when(! $user->isAdmin(), function ($query) use ($user) { + $query->where('users_associated_company.users_id', $user->getId()); + }) ->where('companies_branches.is_deleted', '=', 0); } + public function users(): HasManyThrough + { + return $this->hasManyThrough( + Users::class, + UsersAssociatedCompanies::class, + 'companies_branches_id', + 'id', + 'id', + 'users_id' + ); + } + /** * Get a branch with id 0 , representing the global branch. */ diff --git a/src/Kanvas/Companies/Observers/CompaniesObserver.php b/src/Kanvas/Companies/Observers/CompaniesObserver.php index 24ed1117c..a0433effd 100644 --- a/src/Kanvas/Companies/Observers/CompaniesObserver.php +++ b/src/Kanvas/Companies/Observers/CompaniesObserver.php @@ -33,7 +33,6 @@ public function created(Companies $company): void { $app = app(Apps::class); $user = $company->user()->first(); - $app->associateCompany($company); $createCompanyGroup = new CreateCompanyGroupActions($company, $app); @@ -46,6 +45,7 @@ public function created(Companies $company): void $company->id, $company->users_id, StateEnums::YES->getValue(), + true, $company->email ) ); diff --git a/src/Kanvas/Enums/AppEnums.php b/src/Kanvas/Enums/AppEnums.php index 1314eb920..ded3edea2 100644 --- a/src/Kanvas/Enums/AppEnums.php +++ b/src/Kanvas/Enums/AppEnums.php @@ -93,7 +93,7 @@ public function getValue(): mixed self::KANVAS_APP_BRANCH_HEADER => 'X-Kanvas-Location', self::KANVAS_APP_COMPANY_AUTH_HEADER => 'Company-Authorization', //@deprecated self::DISPLAYNAME_LOGIN => 'displayname_login', - self::VERSION => '1.0-BETA-21', + self::VERSION => '1.0-BETA-22', self::ANONYMOUS_USER_ID => -1 }; } diff --git a/src/Kanvas/Users/Observers/UsersAssociatedAppsObserver.php b/src/Kanvas/Users/Observers/UsersAssociatedAppsObserver.php new file mode 100644 index 000000000..e6759ee98 --- /dev/null +++ b/src/Kanvas/Users/Observers/UsersAssociatedAppsObserver.php @@ -0,0 +1,25 @@ +app->set('total_users', $userAssociatedApp->app->users->count()); + } + + public function updated(UsersAssociatedApps $userAssociatedApp) + { + $userAssociatedApp->app->set('total_users', $userAssociatedApp->app->users->count()); + } + + public function deleted(UsersAssociatedApps $userAssociatedApp) + { + $userAssociatedApp->app->set('total_users', $userAssociatedApp->app->users->count()); + } +} diff --git a/src/Kanvas/Users/Observers/UsersAssociatedCompaniesObserver.php b/src/Kanvas/Users/Observers/UsersAssociatedCompaniesObserver.php new file mode 100644 index 000000000..4b0b930fc --- /dev/null +++ b/src/Kanvas/Users/Observers/UsersAssociatedCompaniesObserver.php @@ -0,0 +1,25 @@ +app->set('total_companies', $userCompanyApps->app->companies->count()); + } + + public function updated(UserCompanyApps $userCompanyApps) + { + $userCompanyApps->app->set('total_companies', $userCompanyApps->app->companies->count()); + } + + public function deleted(UserCompanyApps $userCompanyApps) + { + $userCompanyApps->app->set('total_companies', $userCompanyApps->app->companies->count()); + } +} diff --git a/tests/Connectors/Integration/Zoho/AgentActivityTest.php b/tests/Connectors/Integration/Zoho/AgentActivityTest.php index b9ebd1d55..b5aa7f807 100644 --- a/tests/Connectors/Integration/Zoho/AgentActivityTest.php +++ b/tests/Connectors/Integration/Zoho/AgentActivityTest.php @@ -7,6 +7,8 @@ use Kanvas\Apps\Models\Apps; use Kanvas\Connectors\Zoho\Enums\CustomFieldEnum; use Kanvas\Connectors\Zoho\Workflows\ZohoAgentActivity; +use Kanvas\Connectors\Zoho\ZohoService; +use Kanvas\Guild\Agents\Models\Agent; use Kanvas\Guild\Enums\FlagEnum; use Kanvas\Guild\Leads\Models\Lead; use Kanvas\Workflow\Models\StoredWorkflow; @@ -45,6 +47,11 @@ public function testLeadCreationWorkflow(): void $user->saveOrFail(); $result = $activity->execute($user, $app, ['company' => $company]); + + $zohoService = new ZohoService($app, $company); + $agent = Agent::getByMemberNumber($result['member_id'], $company); + $zohoService->deleteAgent($agent); + $this->assertIsArray($result); $this->assertNotEmpty($result['zohoId']); $this->assertNotEmpty($result['member_id']); diff --git a/tests/Connectors/Integration/Zoho/LeadActivityTest.php b/tests/Connectors/Integration/Zoho/LeadActivityTest.php index 7b60f4529..6d57d0521 100644 --- a/tests/Connectors/Integration/Zoho/LeadActivityTest.php +++ b/tests/Connectors/Integration/Zoho/LeadActivityTest.php @@ -9,6 +9,7 @@ use Kanvas\Apps\Models\Apps; use Kanvas\Connectors\Zoho\Enums\CustomFieldEnum; use Kanvas\Connectors\Zoho\Workflows\ZohoLeadActivity; +use Kanvas\Connectors\Zoho\ZohoService; use Kanvas\Filesystem\Services\FilesystemServices; use Kanvas\Guild\Enums\FlagEnum; use Kanvas\Guild\Leads\Models\Lead; @@ -50,6 +51,10 @@ public function testLeadCreationWorkflow(): void ); $result = $activity->execute($lead, $app, []); + + $zohoService = new ZohoService($app, $company); + $zohoService->deleteLead($lead); + $this->assertArrayHasKey('zohoLeadId', $result); $this->assertArrayHasKey('zohoRequest', $result); $this->assertArrayHasKey('leadId', $result); diff --git a/tests/GraphQL/Ecosystem/Companies/CompanyBranchTest.php b/tests/GraphQL/Ecosystem/Companies/CompanyBranchTest.php index 0cd929aca..e869b5f16 100644 --- a/tests/GraphQL/Ecosystem/Companies/CompanyBranchTest.php +++ b/tests/GraphQL/Ecosystem/Companies/CompanyBranchTest.php @@ -17,6 +17,7 @@ public function branchInputData(int $companyId): array 'phone' => fake()->phoneNumber(), 'email' => fake()->email(), 'country_code' => 'US', + 'is_active' => fake()->boolean(), ]; } diff --git a/tests/GraphQL/Guild/LeadTest.php b/tests/GraphQL/Guild/LeadTest.php index 933167bb0..4f2ba363e 100644 --- a/tests/GraphQL/Guild/LeadTest.php +++ b/tests/GraphQL/Guild/LeadTest.php @@ -4,6 +4,9 @@ namespace Tests\GraphQL\Guild; +use Kanvas\Guild\Leads\Models\Lead; +use Kanvas\Social\MessagesTypes\Models\MessageType; +use Kanvas\SystemModules\Models\SystemModules; use Tests\TestCase; class LeadTest extends TestCase @@ -524,4 +527,96 @@ public function testUnFollowLead() ], ]); } + + public function testChannelMessage() + { + $lead = $this->createLeadAndGetResponse(); + $systemModule = SystemModules::where('name', Lead::class)->first(); + $channel = $this->graphQL(' + query socialChannels($where: QuerySocialChannelsWhereWhereConditions) { + socialChannels(where: $where) { + data { + id + uuid + slug + } + } + } + ', ['where' => ['column' => 'SLUG', 'operator' => 'EQ', 'value' => $lead['data']['createLead']['uuid']]]); + $channel->assertJson([ + 'data' => [ + 'socialChannels' => [ + 'data' => [ + [ + 'slug' => $lead['data']['createLead']['uuid'], + ], + ], + ], + + ], + ]); + $channel = $channel->json()['data']['socialChannels']['data'][0]; + $messageType = MessageType::factory()->create(); + $messageInput = [ + 'message' => json_encode($lead['data']['createLead']), + 'message_types_id' => $messageType->id, + 'system_modules_id' => 1, + 'entity_id' => $lead['data']['createLead']['id'], + 'distribution' => [ + 'distributionType' => 'Channels', + 'channels' => [ + $channel['id'], + ], + 'followers' => [], + ], + ]; + + + $this->graphQL( + ' + mutation createMessage($input: MessageInput!) { + createMessage(input: $input) { + message + } + } + ', + [ + 'input' => $messageInput, + ] + )->assertJson([ + 'data' => [ + 'createMessage' => [ + 'message' => json_encode($lead['data']['createLead']), + ], + ], + ]); + + $message = $this->graphQL( + ' + query($channel_uuid: String!) { + channelMessages( + channel_uuid: $channel_uuid + ) { + data { + message + } + } + } + ', + [ + 'channel_uuid' => $channel['uuid'], + ] + ); + $message->assertJsonStructure([ + 'data' => [ + 'channelMessages' => [ + 'data' => [ + '*' => [ + 'message', + ], + ], + ], + ], + ]); + } }