Skip to content

Commit

Permalink
Merge pull request #964 from FrozenNode/dev
Browse files Browse the repository at this point in the history
fixes for 5.0.11
  • Loading branch information
David Mathews committed Dec 26, 2015
2 parents 5a1d47d + ecaaffe commit b5b59c4
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 3 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.0.11
- Bugfix: Had to make the middleware additon backwards compatable
- Docs: Added doc updates

### 5.0.10
- Bugfix: L5.2 changed the way url() works so added url('/') instead
- Added: Support for middleware additions to the Admin routes via the administrator config
Expand Down
13 changes: 13 additions & 0 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Below is a list of all the available options:

- [Uri](#uri)
- [Domain](#domain)
- [Middleware](#middleware)
- [Title](#title)
- [Model Config Path](#model-config-path)
- [Settings Config Path](#settings-config-path)
Expand Down Expand Up @@ -66,6 +67,18 @@ This is the base route for the administrator package to be called on.

This is the base domain for the administrator route. This can allow you to lock down the admin to just a certain domain/subdomain.

<a name="middleware"></a>
### Middleware

/**
* Admin Routes Additional Middleware
*
* @type array
*/
'middleware' => '',

This is the additional middlewares that you wish to run on administrator route.

<a name="title"></a>
### Title

Expand Down
6 changes: 5 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Administrator is an administrative interface builder for [Laravel](http://larave

- **Author:** Jan Hartigan
- **Website:** [http://frozennode.com](http://administrator.frozennode.com/)
- **Version:** 5.0.10
- **Version:** 5.0.11

[![Build Status](https://travis-ci.org/FrozenNode/Laravel-Administrator.png?branch=master)](https://travis-ci.org/FrozenNode/Laravel-Administrator)

Expand Down Expand Up @@ -63,6 +63,10 @@ Administrator is released under the MIT License. See the LICENSE file for detail

## Recent Changelog

### 5.0.11
- Bugfix: Had to make the middleware additon backwards compatable
- Docs: Added doc updates

### 5.0.10
- Bugfix: L5.2 changed the way url() works so added url('/') instead
- Added: Support for middleware additions to the Admin routes via the administrator config
Expand Down
4 changes: 3 additions & 1 deletion src/Frozennode/Administrator/Config/Factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ class Factory {
protected $rules = array(
'uri' => 'required|string',
'title' => 'required|string',
'domain' => 'string',
'middleware' => 'array',
'model_config_path' => 'required|string|directory',
'settings_config_path' => 'required|string|directory',
'menu' => 'required|array|not_empty',
Expand Down Expand Up @@ -328,4 +330,4 @@ public function fetchConfigFile($name)

return false;
}
}
}
11 changes: 10 additions & 1 deletion src/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,19 @@

use Illuminate\Support\Facades\Route;

/**
* Temperary solution for middleware in routes
* TODO: remove in favor of setting the config for middleware outside of the routes file
*/
$middleware_array = array('Frozennode\Administrator\Http\Middleware\ValidateAdmin');
if(is_array(config('administrator.middleware'))) {
$middleware_array = array_merge(config('administrator.middleware'), $middleware_array);
}

/**
* Routes
*/
Route::group(array('domain' => config('administrator.domain'), 'prefix' => config('administrator.uri'), 'middleware' => [implode(',',config('administrator.middleware')), 'Frozennode\Administrator\Http\Middleware\ValidateAdmin']), function()
Route::group(array('domain' => config('administrator.domain'), 'prefix' => config('administrator.uri'), 'middleware' => $middleware_array), function()
{
//Admin Dashboard
Route::get('/', array(
Expand Down

0 comments on commit b5b59c4

Please sign in to comment.