Create
You can add unlimited role by role create route, role route allow only POST Method
https://ecom.coderorbit.com/public/api/admin/{{app_token}}/role
headers:{
"Accept": "application/json"
"Authorization" : `Bearer ${token}`
}
body:{
"name": "Super Admin",
"status": 2, // 0 | 1, 2 is never delete role
}
### Result
{
"Success"
}
List
Get all role list by GET Method with filter function customized option for you. below list of route with parameter
http://ecom.coderorbit.com/public/api/admin/{{app_token}}/role
headers:{
"Accept": "application/json"
"Authorization" : `Bearer ${token}`
}
### Result
{
"current_page": 1,
"data": [
{
"id": 1,
"name": "Super Admin",
"status": 2,
"created_at": null,
"updated_at": null
},
.......
],
"first_page_url": "",
"from": 1,
"last_page": 1,
"last_page_url": "",
"links": [
{
"url": null,
"label": "« Previous",
"active": false
},
{
"url": "",
"label": "1",
"active": true
},
{
"url": null,
"label": "Next »",
"active": false
}
],
"next_page_url": null,
"path": "",
"per_page": 15,
"prev_page_url": null,
"to": 7,
"total": 7
}
],
=== Query Parameters ===
limit_per_page = 1 // Default 15
name = ''
page = 1 // number of page for pagination
data = all
Here is example url:
==============================================================================================================
GET = https://ecom.coderorbit.com/public/api/admin/{{app_token}}/role
==============================================================================================================
GET = https://ecom.coderorbit.com/public/api/admin/{{app_token}}/role?limit_per_page=1
==============================================================================================================
GET = https://ecom.coderorbit.com/public/api/admin/{{app_token}}/role?name=apple
==============================================================================================================
GET = https://ecom.coderorbit.com/public/api/admin/{{app_token}}/role?page=1
==============================================================================================================
GET = https://ecom.coderorbit.com/public/api/admin/{{app_token}}/role?data=all&limit_per_page=1&name=admin&page=1
==============================================================================================================
Single Show
https://ecom.coderorbit.com/public/api/admin/{{app_token}}/role/{{id}}
headers:{
"Accept": "application/json"
"Authorization" : `Bearer ${token}`
}
### Result
{
"id": 1,
"name": "Super Admin",
"status": 2,
"created_at": null,
"updated_at": null
}
Edit role
https://ecom.coderorbit.com/public/api/admin/{{app_token}}/role/{{id}}/edit
headers:{
"Accept": "application/json"
"Authorization" : `Bearer ${token}`
}
### Result
{
"id": 1,
"name": "Super Admin",
"status": 2,
"created_at": null,
"updated_at": null
}
Update Role
Method allow for Role update PUT/PATCH/POST
https://ecom.coderorbit.com/public/api/admin/{{app_token}}/role/{{id}}
headers:{
"Accept": "application/json"
"Authorization" : `Bearer ${token}`
}
body:{
"name": "Super Admin",
"status": 2, // 0 | 1, 2 is never delete role
}
### Result
{
"id": 1,
"name": "Super Admin",
"status": 2,
"created_at": null,
"updated_at": null
}
DELETE
Method allow for role delete DELETE
https://ecom.coderorbit.com/public/api/admin/{{app_token}}/role/{{id}}
headers:{
"Accept": "application/json"
"Authorization" : `Bearer ${token}`
}
### Result
Success