Skip to content

Commit

Permalink
change package name
Browse files Browse the repository at this point in the history
  • Loading branch information
shin1x1 committed Apr 16, 2015
1 parent 0c825ab commit 992877c
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 31 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# laravel-force-secure-url-scheme
Force secure url schema middleware for Laravel 5
# laravel-force-https-url-scheme
Force https url schema middleware for Laravel 5

[![Build Status](https://travis-ci.org/shin1x1/laravel-force-secure-url-scheme.svg?branch=travis)](https://travis-ci.org/shin1x1/laravel-force-secure-url-scheme)
[![Latest Stable Version](https://poser.pugx.org/shin1x1/laravel-force-secure-url-scheme/version.svg)](https://packagist.org/packages/shin1x1/laravel-force-secure-url-scheme)
[![Build Status](https://travis-ci.org/shin1x1/laravel-force-https-url-scheme.svg?branch=travis)](https://travis-ci.org/shin1x1/laravel-force-https-url-scheme)
[![Latest Stable Version](https://poser.pugx.org/shin1x1/laravel-force-https-url-scheme/version.svg)](https://packagist.org/packages/shin1x1/laravel-force-https-url-scheme)

## Install

```
$ composer require shin1x1/laravel-force-secure-url-scheme
$ composer require shin1x1/laravel-force-https-url-scheme
```

## Usage
Expand All @@ -33,7 +33,7 @@ class Kernel extends HttpKernel
*/
protected $middleware = [
'Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode',
'Shin1x1\ForceSecureUrlScheme\ForceSecureUrlScheme', // <---added
'Shin1x1\ForceHttpsUrlScheme\ForceHttpsUrlScheme', // <---added
'Illuminate\Cookie\Middleware\EncryptCookies',
'Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse',
'Illuminate\Session\Middleware\StartSession',
Expand Down Expand Up @@ -64,15 +64,15 @@ class Kernel extends HttpKernel
'auth' => 'App\Http\Middleware\Authenticate',
'auth.basic' => 'Illuminate\Auth\Middleware\AuthenticateWithBasicAuth',
'guest' => 'App\Http\Middleware\RedirectIfAuthenticated',
'force_secure_url_scheme' => 'Shin1x1\ForceSecureUrlScheme\ForceSecureUrlScheme', // <---added
'force_https_url_scheme' => 'Shin1x1\ForceHttpsUrlScheme\ForceHttpsUrlScheme', // <---added
];
}
```

* app/Http/routes.php

```
Route::group(['middleware' => 'force_secure_url_scheme'], function () {
Route::group(['middleware' => 'force_https_url_scheme'], function () {
get('/admin/', function () {
// something here
});
Expand Down
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "shin1x1/laravel-force-secure-url-scheme",
"description": "Force secure url schema middleware for Laravel 5",
"name": "shin1x1/laravel-force-https-url-scheme",
"description": "Force https url schema middleware for Laravel 5",
"keywords": ["Laravel", "middleware"],
"homepage": "https://github.com/shin1x1/laravel-force-secure-url-scheme",
"homepage": "https://github.com/shin1x1/laravel-force-https-url-scheme",
"license": "MIT",
"authors": [
{
Expand All @@ -22,8 +22,8 @@
},
"autoload": {
"psr-4": {
"Shin1x1\\ForceSecureUrlScheme\\": "src",
"Shin1x1\\ForceSecureUrlScheme\\Test\\": "tests"
"Shin1x1\\ForceHttpsUrlScheme\\": "src",
"Shin1x1\\ForceHttpsUrlScheme\\Test\\": "tests"
}
},
"minimum-stability": "stable"
Expand Down
8 changes: 4 additions & 4 deletions src/ForceSecureUrlScheme.php → src/ForceHttpsUrlScheme.php
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<?php
namespace Shin1x1\ForceSecureUrlScheme;
namespace Shin1x1\ForceHttpsUrlScheme;

use Closure;
use Illuminate\Contracts\Foundation\Application;
use Illuminate\Contracts\Routing\Middleware;
use Illuminate\Http\Request;

/**
* Class ForceSecureUrlScheme
* @package Shin1x1\ForceSecureUrlScheme
* Class ForceHttpsUrlScheme
* @package Shin1x1\ForceHttpsUrlScheme
*/
class ForceSecureUrlScheme implements Middleware
class ForceHttpsUrlScheme implements Middleware
{
/**
* @var Application
Expand Down
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
<?php
namespace Shin1x1\ForceSecureUrlScheme\Test;
namespace Shin1x1\ForceHttpsUrlScheme\Test;

use Exception;
use Illuminate\Http\Request;
use Mockery;
use PHPUnit_Framework_TestCase;
use Shin1x1\ForceSecureUrlScheme\ForceSecureUrlScheme;
use Shin1x1\ForceSecureUrlScheme\Test\Utils\Application;
use Shin1x1\ForceHttpsUrlScheme\ForceHttpsUrlScheme;
use Shin1x1\ForceHttpsUrlScheme\Test\Utils\ForceHttpsUrlSchemeApplication as Application;

/**
* Class ForceSecureUrlSchemeTest
* @package Shin1x1\ForceSecureUrlScheme\Test
* Class ForceHttpsUrlSchemeTest
* @package Shin1x1\ForceHttpsUrlScheme\Test
*/
class ForceSecureUrlSchemeTest extends PHPUnit_Framework_TestCase
class ForceHttpsUrlSchemeTest extends PHPUnit_Framework_TestCase
{
/**
* @var Application
*/
protected $app;
/**
* @var ForceSecureUrlScheme
* @var ForceHttpsUrlScheme
*/
protected $sut;

Expand All @@ -31,7 +31,7 @@ public function setUp()
parent::setUp();

$this->app = new Application();
$this->sut = new ForceSecureUrlScheme($this->app);
$this->sut = new ForceHttpsUrlScheme($this->app);
Helpers::$requestUri = '/path';
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
<?php
namespace Shin1x1\ForceSecureUrlScheme\Test\Utils;
namespace Shin1x1\ForceHttpsUrlScheme\Test\Utils;

use Closure;

class Application implements \Illuminate\Contracts\Foundation\Application
/**
* Class ForceHttpsUrlSchemeApplication
* @package Shin1x1\ForceHttpsUrlScheme\Test\Utils
*/
class ForceHttpsUrlSchemeApplication implements \Illuminate\Contracts\Foundation\Application
{
public $environment = 'production';

Expand Down
8 changes: 4 additions & 4 deletions tests/Utils/Helpers.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php
namespace Shin1x1\ForceSecureUrlScheme\Test {
namespace Shin1x1\ForceHttpsUrlScheme\Test {
/**
* Class Helpers
* @package Shin1x1\ForceSecureUrlSchemeTest
* @package Shin1x1\ForceHttpsUrlScheme\Test
*/
class Helpers
{
Expand All @@ -13,8 +13,8 @@ class Helpers
}
}

namespace Shin1x1\ForceSecureUrlScheme {
use Shin1x1\ForceSecureUrlScheme\Test\Helpers;
namespace Shin1x1\ForceHttpsUrlScheme {
use Shin1x1\ForceHttpsUrlScheme\Test\Helpers;

/**
* @return \Mockery\MockInterface
Expand Down

0 comments on commit 992877c

Please sign in to comment.