Skip to content

Commit

Permalink
Update Permission Details
Browse files Browse the repository at this point in the history
  • Loading branch information
makladuxbert committed Sep 25, 2017
1 parent c645c5c commit a648201
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 54 deletions.
26 changes: 1 addition & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ return [

],

'table_names' => [
'collection_names' => [

/*
* When using the "HasRoles" trait from this package, we need to know which
Expand All @@ -136,30 +136,6 @@ return [
*/

'permissions' => 'permissions',

/*
* When using the "HasRoles" trait from this package, we need to know which
* table should be used to retrieve your models permissions. We have chosen a
* basic default value but you may easily change it to any table you like.
*/

'model_has_permissions' => 'model_has_permissions',

/*
* When using the "HasRoles" trait from this package, we need to know which
* table should be used to retrieve your models roles. We have chosen a
* basic default value but you may easily change it to any table you like.
*/

'model_has_roles' => 'model_has_roles',

/*
* When using the "HasRoles" trait from this package, we need to know which
* table should be used to retrieve your roles permissions. We have chosen a
* basic default value but you may easily change it to any table you like.
*/

'role_has_permissions' => 'role_has_permissions',
],

/*
Expand Down
26 changes: 1 addition & 25 deletions config/permission.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

],

'table_names' => [
'collection_names' => [

/*
* When using the "HasRoles" trait from this package, we need to know which
Expand All @@ -45,30 +45,6 @@
*/

'permissions' => 'permissions',

/*
* When using the "HasRoles" trait from this package, we need to know which
* table should be used to retrieve your models permissions. We have chosen a
* basic default value but you may easily change it to any table you like.
*/

'model_has_permissions' => 'model_has_permissions',

/*
* When using the "HasRoles" trait from this package, we need to know which
* table should be used to retrieve your models roles. We have chosen a
* basic default value but you may easily change it to any table you like.
*/

'model_has_roles' => 'model_has_roles',

/*
* When using the "HasRoles" trait from this package, we need to know which
* table should be used to retrieve your roles permissions. We have chosen a
* basic default value but you may easily change it to any table you like.
*/

'role_has_permissions' => 'role_has_permissions',
],

/*
Expand Down
4 changes: 2 additions & 2 deletions src/Models/Permission.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function __construct(array $attributes = [])

$this->helpers = new Helpers();

$this->setTable(\config('permission.table_names.permissions'));
$this->setTable(\config('permission.collection_names.permissions'));
}

/**
Expand Down Expand Up @@ -72,7 +72,7 @@ public function roles(): BelongsToMany
{
return $this->belongsToMany(
\config('permission.models.role'),
\config('permission.table_names.role_has_permissions')
\config('permission.collection_names.role_has_permissions')
);
}

Expand Down
4 changes: 2 additions & 2 deletions src/Models/Role.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function __construct(array $attributes = [])

$this->helpers = new Helpers();

$this->setTable(\config('permission.table_names.roles'));
$this->setTable(\config('permission.collection_names.roles'));
}

/**
Expand Down Expand Up @@ -71,7 +71,7 @@ public function permissions(): BelongsToMany
{
return $this->belongsToMany(
\config('permission.models.permission'),
\config('permission.table_names.role_has_permissions')
\config('permission.collection_names.role_has_permissions')
);
}

Expand Down

0 comments on commit a648201

Please sign in to comment.