https://github.com/bkstar123/bkscms-admin-panel
https://github.com/bkstar123/bkscms-admin-panel
admin-management admin-panel authenticaiton authorization laravel
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/bkstar123/bkscms-admin-panel
- Owner: bkstar123
- Created: 2019-09-02T11:05:14.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2022-03-03T08:23:25.000Z (over 4 years ago)
- Last Synced: 2025-09-19T19:57:44.146Z (9 months ago)
- Topics: admin-management, admin-panel, authenticaiton, authorization, laravel
- Language: PHP
- Size: 104 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# bkscms-admin-panel
> A bkstar123/bkscms's package adding an admin panel (with authentication & authorization features) for a **BKSCMS** project
For creating a **BKSCMS** project, run the following command:
```composer create-project --prefer-dist bkstar123/bkscms ```
## 1. Requirement
It is recommended to install this package with PHP version 7.1.3+ and Laravel Framework version 5.6+
## 2. Installation
composer require bkstar123/bkscms-admin-panel
Then, publish the package's configuration file (you do not need to do it if you run ```php artian bkscms:install``` to install the **BKSCMS** project):
```php artisan vendor:publish --provider=Bkstar123\BksCMS\AdminPanel\Providers\AdminPanelServiceProvider```
## 3. Usage
The package offers an artisan command ```php artisan bkscms:initAuth --scope=```
All the following steps are not required if you run ```php artian bkscms:install``` to install the **BKSCMS** project.
- Create database tables
```php artisan migrate```
- Seed data to ***roles, admins, permissions*** tables and do other arrangements
```php artisan bkscms:initAuth --scope=all```
- Create full-text index for ***roles, permissions, admins*** tables
```php
php artisan mysql-search:init Bkstar123\BksCMS\AdminPanel\Admin
php artisan mysql-search:init Bkstar123\BksCMS\AdminPanel\Role
php artisan mysql-search:init Bkstar123\BksCMS\AdminPanel\Permission
```
It will create two users ***superadmin*** & ***administrator*** with passwords ***superadmin1@*** and ***administrator1@*** respectively. You can use these credentials to login and create your own users (you must assign ***superadmins*** role to at least one user). Finally, do not forget to remove/disable the default ***superadmin & administrator*** users for security reason before rolling out to production environment.
Later, when you add more permissions to **permissions** key in **config/bkstar123_bkscms_adminpanel.php**, you can just run ```php artisan bkscms:initAuth --scope=permissions``` to re-initialize the permissions table
In the controller, import & use the trait ***Bkstar123\BksCMS\AdminPanel\Traits\AuthorizationShield***, then you can place a call to ```$this->capabilityCheck(, )``` in every controller action that need to perform authorization check.
**Note**
The package provides ***bkscms-auth*** & ***bkscms-guest*** middleware to replace ***auth*** & ***guest*** respectively for all CMS routes (i.e under the path ***/cms/\****)