You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> Notice the key `department-permissions` it generated from `DepartmentController` and permissions are generated from DepartmentController's routes.
38
+
26
39
## PermissionGenerator trait [Optional]
27
40
While this package generate permission names from route names, in some cases we might need to exclude some routes so that it won't generate as permission names. To do so implement the **WithPermissionGenerator** contracts in the controller, then use the **PermissionGenerator** trait.
28
41
@@ -50,16 +63,6 @@ class OfficeController extends Controller implements WithPermissionGenerator
50
63
51
64
> **PermissionGenerator** trait is optional. Because if no group permission title defined, then this package dynamically generate a title based on controller name. Routes can be excluded in the config file in order to tell the package not to generate those routes as permission names.
> Notice the key `department-permissions` it generated from `DepartmentController` and permissions are generated from DepartmentController's routes.
62
-
63
66
## Permission View Builder Facade
64
67
The package comes with predefined a view with permission names
65
68
@@ -77,7 +80,7 @@ The package comes with predefined a view with permission names
77
80
> $request->get('permissions'); // array of permissions
78
81
> ```
79
82
80
-
## Example
83
+
### Example
81
84
**In controller:**
82
85
83
86
```php
@@ -184,7 +187,7 @@ Config the **config/permission-generator.php** file.
184
187
> Note: notice the `user-permission` key which contains only permission name, the package dynamically make a title for the permission name.
185
188
>
186
189
187
-
3. We can define controller by it's namespace, it could be whole namespace or it could be sub/prefix of controller namespace. This config play vital role to generate permissions because permissions will be generated only for our defined controllers.
190
+
3. Define controller by it's namespace, it could be whole namespace or it could be sub/prefix of controller namespace. This config play vital role to generate permissions because permissions will be generated only for defined controllers.
0 commit comments