Skip to content

Commit

Permalink
Disabled upgrade command and fix middleware plural
Browse files Browse the repository at this point in the history
  • Loading branch information
santigarcor committed Oct 4, 2017
1 parent a561688 commit 8badb71
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ To install, configure and learn how to use Laratrust please go to the [Documenta
- Events when roles and permissions are attached, detached or synced.
- Multiple roles and permissions can be attached to users within teams.
- Objects ownership verification.
- Multiple guards for the middlewares.
- Multiple guards for the middleware.
- [Laravel gates and policies](http://laratrust.readthedocs.io/en/5.0/troubleshooting.html).

## License
Expand Down
2 changes: 1 addition & 1 deletion docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ Installation

php artisan config:clear

5. The :doc:`middlewares </usage/middleware>` are registered automatically as ``role``, ``permission`` and ``ability`` . If you want to customize or change them, please refer to the :ref:`middleware configuration <middleware-configuration>`.
5. The :doc:`middleware </usage/middleware>` are registered automatically as ``role``, ``permission`` and ``ability`` . If you want to customize or change them, please refer to the :ref:`middleware configuration <middleware-configuration>`.


2 changes: 1 addition & 1 deletion docs/usage/middleware.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Middleware
Configuration
^^^^^^^^^^^^^

The middlewares are registered automatically as ``role``, ``permission`` and ``ability`` . If you want to change or customize them, go to your ``config/laratrust.php`` and set the ``middleware.register`` value to ``false`` and add the following to the ``routeMiddleware`` array in ``app/Http/Kernel.php``::
The middleware are registered automatically as ``role``, ``permission`` and ``ability`` . If you want to change or customize them, go to your ``config/laratrust.php`` and set the ``middleware.register`` value to ``false`` and add the following to the ``routeMiddleware`` array in ``app/Http/Kernel.php``::

'role' => \Laratrust\Middleware\LaratrustRole::class,
'permission' => \Laratrust\Middleware\LaratrustPermission::class,
Expand Down
4 changes: 3 additions & 1 deletion src/Commands/UpgradeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class UpgradeCommand extends Command
*
* @var string
*/
protected $description = 'Creates a migration to upgrade laratrust from version 3.2 to 4.0.';
protected $description = 'Creates a migration to upgrade laratrust from version 4.0 to 5.0.';

/**
* Suffix of the migration name.
Expand All @@ -43,6 +43,8 @@ class UpgradeCommand extends Command
*/
public function handle()
{
$this->info("There is nothing to upgrade through the command.");
return;
$this->laravel->view->addNamespace('laratrust', substr(__DIR__, 0, -8).'views');

$this->line('');
Expand Down
4 changes: 2 additions & 2 deletions src/LaratrustServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public function boot()

$this->useMorphMapForRelationships();

$this->autoRegisterMiddlewares();
$this->registerMiddlewares();

if (class_exists('\Blade')) {
$this->registerBladeDirectives();
Expand All @@ -89,7 +89,7 @@ protected function useMorphMapForRelationships()
*
* @return void
*/
protected function autoRegisterMiddlewares()
protected function registerMiddlewares()
{
if (!$this->app['config']->get('laratrust.middleware.register')) {
return;
Expand Down
4 changes: 2 additions & 2 deletions src/config/laratrust.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,12 +175,12 @@
| Laratrust Middleware
|--------------------------------------------------------------------------
|
| This configuration helps to customize the Laratrust middlewares behavior.
| This configuration helps to customize the Laratrust middleware behavior.
|
*/
'middleware' => [
/**
* Define if the laratrust middlewares are registered automatically in the service provider
* Define if the laratrust middleware are registered automatically in the service provider
*/
'register' => true,

Expand Down

0 comments on commit 8badb71

Please sign in to comment.