Skip to content

Commit

Permalink
Merge pull request #15 from olssonm/dev
Browse files Browse the repository at this point in the history
Prepare for Laravel 5.5 support.
  • Loading branch information
olssonm authored Aug 30, 2017
2 parents e513e02 + 1e21395 commit 5f8c581
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 10 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
language: php
php:
- 5.6
- 7.0
- nightly

Expand Down
29 changes: 26 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# Laravel 5 Very Basic Auth

[![Latest Version on Packagist][ico-version]][link-packagist]
[![Total downloads][ico-downloads]][link-packagist]
[![Software License][ico-license]](LICENSE.md)
[![Build Status][ico-travis]][link-travis]

This package allows you to add a HTTP Basic Auth filter on your routes, without the need to actually use a database – which the Laravel default `auth.basic`-middleware relies on.

![Screenshot](https://cloud.githubusercontent.com/assets/907114/9154094/a34c231a-3e80-11e5-81cc-993b844d6e2f.png)
<img width="400" alt="Screenshot" src="https://user-images.githubusercontent.com/907114/29876493-3907afd8-8d9d-11e7-8068-f461855c493b.png">

Perfect if you want to give for example clients access to your development site, and you have yet to set up your database and/or models. Or perhaps your site doesn't even use a database and you still wish to keep it protected.

Expand All @@ -23,6 +24,7 @@ While HTTP Basic Auth does give you a protection layer against unwanted visitors
5.1.x/5.2.x | 1.x
5.3.x | 2.x
5.4.x | 3.x
5.5.x | 4.x

#### Using Laravel 4.x?

Expand All @@ -36,7 +38,25 @@ Via Composer
$ composer require olssonm/l5-very-basic-auth
```

Pop in the provider in the providers array (`config/app.php`).
Since v4.* (for Laravel 5.5) this package uses Package Auto-Discovery for loading the service provider. Once installed you should see the message

```
Discovered Package: olssonm/l5-very-basic-auth
```

If you would like to manually add the provider, turn of Auto-Discovery for the package in your composer.json-file:

``` json
"extra": {
"laravel": {
"dont-discover": [
"olssonm/l5-very-basic-auth"
]
}
},
```

And then add the provider in the providers array (`config/app.php`).

``` php
'providers' => [
Expand All @@ -46,7 +66,9 @@ Pop in the provider in the providers array (`config/app.php`).

## Configuration

Run the command `$ php artisan vendor:publish --provider="Olssonm\VeryBasicAuth\VeryBasicAuthServiceProvider"` to publish the configuration. The file `very_basic_auth.php` will be copied to your `app/config`-folder – here you can set various options such as username and password.
Run the command `$ php artisan vendor:publish` and select `Provider: Olssonm\VeryBasicAuth\VeryBasicAuthServiceProvider` to publish the configuration. You could also type `$ php artisan vendor:publish --provider="Olssonm\VeryBasicAuth\VeryBasicAuthServiceProvider"` to directly publish the files.

The file `very_basic_auth.php` will then be copied to your `app/config`-folder – here you can set various options such as username and password.

### Note

Expand Down Expand Up @@ -113,5 +135,6 @@ The MIT License (MIT). Please see [License File](LICENSE.md) for more informatio
[ico-version]: https://img.shields.io/packagist/v/olssonm/l5-very-basic-auth.svg?style=flat-square
[ico-license]: https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square
[ico-travis]: https://img.shields.io/travis/olssonm/l5-very-basic-auth/master.svg?style=flat-square
[ico-downloads]: https://img.shields.io/packagist/dt/olssonm/l5-very-basic-auth.svg?style=flat-square
[link-packagist]: https://packagist.org/packages/olssonm/l5-very-basic-auth
[link-travis]: https://travis-ci.org/olssonm/l5-very-basic-auth
17 changes: 11 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@
"authors": [
{
"name": "Marcus Olsson",
"email": "hello@marcusolsson.me",
"email": "contact@marcusolsson.me",
"homepage": "https://marcusolsson.me"
}
],
"require": {
"illuminate/support": "~5.4",
"php" : ">=5.6.0"
"illuminate/support": "~5.5",
"php" : ">=7.0"
},
"require-dev": {
"phpunit/phpunit" : "5.7.*",
"orchestra/testbench": "~3.4"
"phpunit/phpunit" : "~6.0",
"orchestra/testbench": "~3.5"
},
"autoload": {
"psr-4": {
Expand All @@ -39,7 +39,12 @@
},
"extra": {
"branch-alias": {
"dev-master": "3.x-dev"
"dev-master": "4.x-dev"
},
"laravel": {
"providers": [
"Olssonm\\VeryBasicAuth\\VeryBasicAuthServiceProvider"
]
}
},
"minimum-stability": "stable"
Expand Down

0 comments on commit 5f8c581

Please sign in to comment.