Skip to content

Commit

Permalink
Add Laravel 5.2 support
Browse files Browse the repository at this point in the history
  • Loading branch information
vinkla committed Nov 15, 2015
1 parent 8378a97 commit 67512cc
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# CHANGELOG

## 5.1.0 (released 2015-11-15)

- Added Laravel 5.2 support

## 5.0.3 (released 2015-11-02)

- Added new access token exception
Expand Down
14 changes: 7 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
],
"require": {
"php": ">=5.5.9",
"illuminate/database": "5.1.*",
"illuminate/console": "5.1.*",
"illuminate/contracts": "5.1.*",
"illuminate/http": "5.1.*",
"illuminate/support": "5.1.*",
"illuminate/config": "5.1.*",
"illuminate/database": "5.1.* || 5.2.*",
"illuminate/console": "5.1.* || 5.2.*",
"illuminate/contracts": "5.1.* || 5.2.*",
"illuminate/http": "5.1.* || 5.2.*",
"illuminate/support": "5.1.* || 5.2.*",
"illuminate/config": "5.1.* || 5.2.*",
"league/oauth2-server": "4.1.*"
},
"require-dev": {
Expand Down Expand Up @@ -49,7 +49,7 @@
},
"extra": {
"branch-alias": {
"dev-master": "5.0-dev"
"dev-master": "5.1-dev"
}
},
"minimum-stability": "dev",
Expand Down
8 changes: 5 additions & 3 deletions src/OAuth2ServerServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
namespace LucaDegasperi\OAuth2Server;

use Illuminate\Contracts\Foundation\Application;
use Illuminate\Foundation\Application as LaravelApplication;
use Illuminate\Support\ServiceProvider;
use Laravel\Lumen\Application as LumenApplication;
use League\OAuth2\Server\AuthorizationServer;
use League\OAuth2\Server\ResourceServer;
use League\OAuth2\Server\Storage\AccessTokenInterface;
Expand Down Expand Up @@ -55,9 +57,9 @@ protected function setupConfig(Application $app)
{
$source = realpath(__DIR__.'/../config/oauth2.php');

if (class_exists('Illuminate\Foundation\Application', false) && $app->runningInConsole()) {
if ($app instanceof LaravelApplication && $app->runningInConsole()) {
$this->publishes([$source => config_path('oauth2.php')]);
} elseif (class_exists('Laravel\Lumen\Application', false)) {
} elseif ($app instanceof LumenApplication) {
$app->configure('oauth2');
}

Expand All @@ -75,7 +77,7 @@ protected function setupMigrations(Application $app)
{
$source = realpath(__DIR__.'/../database/migrations/');

if (class_exists('Illuminate\Foundation\Application', false) && $app->runningInConsole()) {
if ($app instanceof LaravelApplication && $app->runningInConsole()) {
$this->publishes([$source => database_path('migrations')], 'migrations');
}
}
Expand Down

0 comments on commit 67512cc

Please sign in to comment.