diff --git a/CHANGELOG.md b/CHANGELOG.md index 81e0dc7..b2ce260 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,19 @@ All notable changes to `one-app` will be documented in this file. +## v1.0.21 - 2024-06-20 + +### What's Changed + +* Fix installation command by @imanghafoori1 in https://github.com/envor/one-app/pull/26 +* Don't check for team until the payload is being created by @inmanturbo in https://github.com/envor/one-app/pull/27 + +### New Contributors + +* @imanghafoori1 made their first contribution in https://github.com/envor/one-app/pull/26 + +**Full Changelog**: https://github.com/envor/one-app/compare/v1.0.20...v1.0.21 + ## v1.0.20 - 2024-06-04 ### What's Changed diff --git a/composer.json b/composer.json index 4f4b5cf..a5a6375 100644 --- a/composer.json +++ b/composer.json @@ -17,7 +17,7 @@ ], "require": { "php": "^8.2", - "envor/laravel-datastore": "^1.2", + "envor/laravel-datastore": "^1.2.14", "envor/laravel-schema-macros": "^1.1", "envor/platform": "^1.6", "headerx/laravel-jetstream-passport": "^1.0", diff --git a/stubs/one-app/app/Models/Team.php b/stubs/one-app/app/Models/Team.php index a6ab9a1..dc7fe84 100644 --- a/stubs/one-app/app/Models/Team.php +++ b/stubs/one-app/app/Models/Team.php @@ -58,6 +58,8 @@ protected function casts(): array protected function configured(): void { app()->forgetInstance('team'); + app()->forgetInstance('datastore_context'); + app()->instance('datastore_context', $this); app()->instance('team', $this); } } diff --git a/stubs/one-app/app/Providers/DomainServiceProvider.php b/stubs/one-app/app/Providers/DomainServiceProvider.php index 665ce04..6b22002 100644 --- a/stubs/one-app/app/Providers/DomainServiceProvider.php +++ b/stubs/one-app/app/Providers/DomainServiceProvider.php @@ -55,15 +55,21 @@ public function configureRequests() public function configureQueue() { $this->app['queue']->createPayloadUsing(function () { - return isset($this->app['team']) ? [ - 'team_uuid' => $this->app['team']->uuid, - ] : []; + $datastoreContext = $this->app[HasDatastoreContext::class]->datastoreContext(); + + if (! $datastoreContext) { + return []; + } + + return [ + 'team_uuid' => $datastoreContext->uuid, + ]; }); $this->app['events']->listen(JobProcessing::class, function ($event) { if (isset($event->job->payload()['team_uuid'])) { $team = Team::where('uuid', $event->job->payload()['team_uuid'])->first(); - $team->configure()->use(); + $team?->configure()?->use(); } }); }