Skip to content

Commit

Permalink
Merge pull request #1 from JamesForks/updates
Browse files Browse the repository at this point in the history
Allow Laravel 5.0, 5.1 and 5.2, move middleware and config files
  • Loading branch information
sebastiandedeyne committed Jan 4, 2016
2 parents f9abe4d + 91a892f commit b4bcc19
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 10 deletions.
4 changes: 2 additions & 2 deletions composer.json
Expand Up @@ -18,8 +18,8 @@
"require": {
"php" : ">=5.5.0",
"spatie/url-signer": "^1.0.1",
"illuminate/support": "^5.0",
"illuminate/http": "^5.0"
"illuminate/support": "5.0.*|5.1.*|5.2.*",
"illuminate/http": "5.0.*|5.1.*|5.2.*"
},
"require-dev": {
"phpunit/phpunit" : "4.*",
Expand Down
File renamed without changes.
@@ -1,6 +1,6 @@
<?php

namespace Spatie\UrlSigner\Laravel\Middleware;
namespace Spatie\UrlSigner\Laravel\Http\Middleware;

use Closure;

Expand Down
26 changes: 20 additions & 6 deletions src/UrlSignerServiceProvider.php
Expand Up @@ -2,9 +2,10 @@

namespace Spatie\UrlSigner\Laravel;

use Illuminate\Contracts\Foundation\Application;
use Illuminate\Routing\Router;
use Illuminate\Support\ServiceProvider;
use Spatie\UrlSigner\Laravel\Middleware\ValidateSignature;
use Spatie\UrlSigner\Laravel\Http\Middleware\ValidateSignature;
use Spatie\UrlSigner\UrlSigner as UrlSignerContract;

class UrlSignerServiceProvider extends ServiceProvider
Expand All @@ -14,18 +15,31 @@ class UrlSignerServiceProvider extends ServiceProvider
*/
public function boot()
{
$this->publishes([
__DIR__.'/../resources/config/laravel-url-signer.php' =>
$this->app->configPath().'/'.'laravel-url-signer.php',
], 'config');
$this->setupConfig($this->app);
}

/**
* Setup the config.
*
* @param \Illuminate\Contracts\Foundation\Application $app
*
* @return void
*/
protected function setupConfig(Application $app)
{
$source = realpath(__DIR__.'/../config/laravel-url-signer.php');
$this->publishes([$source => config_path('laravel-url-signer.php')]);
$this->mergeConfigFrom($source, 'laravel-url-signer');
}

/**
* Register the service provider.
*
* @return void
*/
public function register()
{
$this->mergeConfigFrom(__DIR__.'/../resources/config/laravel-url-signer.php', 'laravel-url-signer');
$this->mergeConfigFrom(__DIR__.'/../config/laravel-url-signer.php', 'laravel-url-signer');

$config = config('laravel-url-signer');

Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase.php
Expand Up @@ -4,7 +4,7 @@

use Illuminate\Database\Schema\Blueprint;
use Orchestra\Testbench\TestCase as Orchestra;
use Spatie\UrlSigner\Laravel\Middleware\ValidateSignature;
use Spatie\UrlSigner\Laravel\Http\Middleware\ValidateSignature;
use Spatie\UrlSigner\Laravel\UrlSignerServiceProvider;

abstract class TestCase extends Orchestra
Expand Down

0 comments on commit b4bcc19

Please sign in to comment.