Skip to content

Commit 23d3f4e

Browse files
committed
changes for first relese
1 parent a62b318 commit 23d3f4e

File tree

2 files changed

+13
-20
lines changed

2 files changed

+13
-20
lines changed

README.md

+12-19
Original file line numberDiff line numberDiff line change
@@ -78,21 +78,14 @@ IN blade.php
7878
```
7979

8080
### Functions List
81-
`role`: Return the Role collection of modal.
82-
83-
`hasRole` `@hasRole` : Check Loggedin User has the role.
84-
85-
`hasAnyRole` `@hasAnyRole` : Checks if the user has any of the specified roles.
86-
87-
`permission`: Get the permission collection from permission modal.
88-
89-
`@hasPermission` `@haspermission`: Check Loggedin user has the permission.
90-
91-
`hasAnyPermission` `@hasAnyPermission`: Checks if the user has any of the specified permissions.
92-
93-
`hasAllPermission` `@hasAllPermission`: Verifies that the user has all the specified permissions.
94-
95-
`hasExactPermissions` `@hasExactPermissions`: Checks if the user has exactly the specified permissions.
81+
- `role` : Return the Role collection of modal.
82+
- `hasRole` `@hasRole` : Check Loggedin User has the role.
83+
- `hasAnyRole` `@hasAnyRole` : Checks if the user has any of the specified roles.
84+
- `permission` : Get the permission collection from permission modal.
85+
- `@hasPermission` `@haspermission` : Check Loggedin user has the permission.
86+
- `hasAnyPermission` `@hasAnyPermission` : Checks if the user has any of the specified permissions.
87+
- `hasAllPermission` `@hasAllPermission` : Verifies that the user has all the specified permissions.
88+
- `hasExactPermissions` `@hasExactPermissions` : Checks if the user has exactly the specified permissions.
9689

9790
## Seeding Roles and Permissions
9891
You can create a seeder to start with some default roles and permissions. For example:
@@ -128,10 +121,10 @@ class RolesAndPermissionsSeeder extends Seeder
128121
## Database Schema
129122
Ensure your database schema is set up correctly. The following tables should exist:
130123

131-
- `roles`: To store roles.
132-
- `permissions`: To store permissions.
133-
- `role_permission`: Pivot table to manage many-to-many relationships between roles and permissions.
134-
- `users`: Ensure there is a `role_id` column in the `users` table to associate users with their roles.
124+
- `roles` : To store roles.
125+
- `permissions` : To store permissions.
126+
- `role_permission` : Pivot table to manage many-to-many relationships between roles and permissions.
127+
- `users` : Ensure there is a `role_id` column in the `users` table to associate users with their roles.
135128

136129
## Conclusion
137130
This package provides a simple way to manage user roles and permissions in your Laravel application. For further customization or additional features, feel free to contribute or reach out for support.

src/database/migrations/create_permission_tables.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function up()
3535
if (Schema::hasTable('users')) {
3636
if (!Schema::hasColumn('users', 'role_id')) {
3737
Schema::table('users', function (Blueprint $table) {
38-
$table->foreignId('role_id')->nullable()->constrained('roles')->onDelete('set null');
38+
$table->foreignId('role_id')->nullable()->constrained('roles')->onDelete('set null')->after('id');;
3939
});
4040
}
4141
}

0 commit comments

Comments
 (0)