Improved Horizon documentation regarding tags (#57)

- Fixed the snippet for passing tags to the job
- Wrapped content in a Tags header to prepare for more content in the
future
- Added comment to method to mimic Laravel's documentation regardin the
matter
- Made it slightly more clear that the tags method should be applied to
the actual job class
This commit is contained in:
Jørgen Solli 2020-06-23 21:56:35 +02:00 committed by GitHub
parent 9949f888e4
commit 4a5d121dfb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -8,13 +8,20 @@ section: content
Make sure your [queues]({{ $page->link('queues') }}) are configured correctly before using this. Make sure your [queues]({{ $page->link('queues') }}) are configured correctly before using this.
You may add the current tenant's id to your job tags: ## Tags
You may add the current tenant's id to your job tags by defining a `tags` method on the class:
```php ```php
/**
* Get the tags that should be assigned to the job.
*
* @return array
*/
public function tags() public function tags()
{ {
return [ return [
'tenant' => tenant('id'), 'tenant:' . tenant('id'),
]; ];
} }
``` ```