Skip to content

Commit

Permalink
Merge pull request #27 from envor/main
Browse files Browse the repository at this point in the history
Don't check for team until the payload is being created
  • Loading branch information
inmanturbo authored Jun 20, 2024
2 parents 6f89e2c + f189b6d commit e06fb19
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 15 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@

All notable changes to `one-app` will be documented in this file.

## v1.0.20 - 2024-06-04

### What's Changed

* Bump dependabot/fetch-metadata from 1.6.0 to 2.0.0 by @dependabot in https://github.com/envor/one-app/pull/22
* Bump aglipanci/laravel-pint-action from 2.3.1 to 2.4 by @dependabot in https://github.com/envor/one-app/pull/23
* Bump dependabot/fetch-metadata from 2.0.0 to 2.1.0 by @dependabot in https://github.com/envor/one-app/pull/24
* strings for optional uuid types by @inmanturbo in https://github.com/envor/one-app/pull/25

**Full Changelog**: https://github.com/envor/one-app/compare/v1.0.19...v1.0.20

## v1.0.19 - 2024-03-22

### What's Changed
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ laravel new one-app
### Or using composer

```bash
composer create project "laravel/laravel:^11.0" one-app
composer create-project "laravel/laravel:^11.0" one-app
```

```bash
Expand Down
23 changes: 9 additions & 14 deletions stubs/one-app/app/Providers/DomainServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ public function configureRequests()

// migrate only once a day
if (! cache()->has('team_migrated_'.$team->id)) {
$team
->migrate();
$team->migrate();
cache()->put('team_migrated_'.$team->id, true, now()->addDay());
}

Expand All @@ -55,20 +54,16 @@ public function configureRequests()

public function configureQueue()
{
if (isset($this->app['team'])) {
$this->app['queue']->createPayloadUsing(function () {
return $this->app['team'] ? [
'team_uuid' => $this->app['team']->uuid,
] : [];
});
}
$this->app['queue']->createPayloadUsing(function () {
return isset($this->app['team']) ? [
'team_uuid' => $this->app['team']->uuid,
] : [];
});

$this->app['events']->listen(JobProcessing::class, function ($event) {
if (isset($event->job->payload['team_uuid'])) {
$team = Team::whereUuid($event->job->payload['team_uuid'])->first();
if (isset($team->id)) {
$team->configure()->use();
}
if (isset($event->job->payload()['team_uuid'])) {
$team = Team::where('uuid', $event->job->payload()['team_uuid'])->first();
$team->configure()->use();
}
});
}
Expand Down

0 comments on commit e06fb19

Please sign in to comment.