Skip to content

Commit

Permalink
Merge pull request #15 from squigg/8.x
Browse files Browse the repository at this point in the history
Support for Laravel 8.x
  • Loading branch information
squigg authored Sep 19, 2020
2 parents c70c57b + a3762a5 commit 91c8f56
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 11 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ composer.lock
.DS_Store
.idea
/test-coverage/
.phpunit.result.cache
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
language: php

php:
- '7.2'
- '7.3'
- '7.4'

install:
- travis_retry composer install --no-interaction
Expand Down
39 changes: 32 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,12 @@ azure-queue-laravel
PHP Laravel Queue Driver package to support Microsoft Azure Storage Queues

## Prerequisites

- PHP 5.6+, PHP 7+ for Laravel 5.5+, PHP 7.1+ for Laravel 5.6+, PHP 7.2+ for Laravel 6+
- Laravel 5.2 - 7.x (not tested on previous versions)
- Laravel 5.2 - 8.x (not tested on previous versions)
- PHP 5.6+ for Laravel 5.2+
- PHP 7+ for Laravel 5.5+
- PHP 7.1+ for Laravel 5.6+
- PHP 7.2+ for Laravel 6+
- PHP 7.3+ for Laravel 8+
- Microsoft Azure Storage Account and Storage Account Key
- Queue container created through Azure Portal or via
[Azure CLI](https://docs.microsoft.com/en-us/cli/azure/storage/queue?view=azure-cli-latest#az-storage-queue-create)
Expand All @@ -23,7 +26,25 @@ or [PowerShell](https://docs.microsoft.com/en-us/azure/storage/queues/storage-po
### Install using composer
You can find this library on [Packagist](https://packagist.org/packages/squigg/azure-queue-laravel).

#### Important notes for Laravel 8
Laravel 8 has moved to Guzzle 7.x, but the upstream dependency `microsoft/azure-storage-queue` from this package still uses Guzzle 6.
This will cause `composer` to fail during dependency resolution.

Tests so far have not identified any impacting breaking changes between Guzzle 6 and 7, so while we wait for the upstream package to be updated, you can work around this issue by adding/updating your root
`composer.json` file to use an inline alias for `guzzlehttp/guzzle`:
```
"guzzlehttp/guzzle": "7.0.1 as 6.5.5"
```
Or run this command:
```
composer require guzzlehttp/guzzle:"7.0.1 as 6.5.5"
```
#### Installation
Require this package in your `composer.json`. The version numbers will follow Laravel.

#### Laravel 8.x
"squigg/azure-queue-laravel": "^8.0"
composer require squigg/azure-queue-laravel:^8.0
#### Laravel 7.x
"squigg/azure-queue-laravel": "^7.0"
composer require squigg/azure-queue-laravel:^7.0
Expand Down Expand Up @@ -89,21 +110,23 @@ fill out your own connection data from the Azure Management portal:
'accountname' => env('AZURE_QUEUE_STORAGE_NAME'), // Azure storage account name
'key' => env('AZURE_QUEUE_KEY'), // Access key for storage account
'queue' => env('AZURE_QUEUE_NAME'), // Queue container name
'timeout' => 60 // Seconds before a job is released back to the queue
'timeout' => 60, // Seconds before a job is released back to the queue
'endpoint' => env('AZURE_QUEUE_ENDPOINTSUFFIX'), // Optional endpoint suffix if different from core.windows.net
],

Add environment variables into your `.env` file to set the above configuration parameters if you prefer:
Add environment variables into your `.env` file to set the above configuration parameters:

AZURE_QUEUE_STORAGE_NAME=xxx
AZURE_QUEUE_KEY=xxx
AZURE_QUEUE_NAME=xxx
AZURE_QUEUE_ENDPOINTSUFFIX=xxx

#### Set the default Laravel queue
Update the default queue used by Laravel by setting the `QUEUE_DRIVER` value in your `.env` file to `azure`.
Update the default queue used by Laravel by setting the `QUEUE_CONNECTION` value in your `.env` file to `azure`.

QUEUE_DRIVER=azure
QUEUE_CONNECTION=azure

This setting is `QUEUE_DRIVER` in older versions of Laravel.

## Usage
Use the normal Laravel Queue functionality as per the [documentation](http://laravel.com/docs/queues).
Expand All @@ -112,6 +135,8 @@ Remember to update the default queue by setting the `QUEUE_DRIVER` value in your

## Changelog

2020-09-19 - V8.0 - Support for Laravel 8.x (composer dependency and test refactoring only)

2020-06-04 - V7.0 - Support for Laravel 7.x (composer dependency and test refactoring only)

2020-06-04 - V6.0 - Support for Laravel 6.x (composer dependency changes only)
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
}
],
"require": {
"php": "^7.2.5",
"illuminate/queue": "^7.0",
"php": "^7.3",
"illuminate/queue": "^8.0",
"microsoft/azure-storage-queue": "~1.3.0"
},
"require-dev": {
"phpunit/phpunit": "^8.0|^9.0",
"orchestra/testbench": "^5.0",
"orchestra/testbench": "^6.0",
"mockery/mockery": "~1.0",
"php-coveralls/php-coveralls": "~2.0",
"ext-json": "*"
Expand Down

0 comments on commit 91c8f56

Please sign in to comment.