Pages
This section covers the API endpoints for managing pages in the admin panel.
List Pages
GET /v1/admin/pages
Returns a list of pages with pagination support.
Query Parameters
| Parameter | Type | Description | Validation Rules |
|---|---|---|---|
search_text | string | Search in page titles and keys | Optional |
per_page | integer | Number of items per page | Optional, default: 10 |
Response
{
"success": true,
"message": "تم جلب البيانات بنجاح.",
"data": {
"current_page": 1,
"first_page_url": "http://192.168.0.139:8080/v1/admin/pages?page=1",
"from": 1,
"last_page": 1,
"last_page_url": "http://192.168.0.139:8080/v1/admin/pages?page=1",
"links": [
{
"url": null,
"label": "« السابق",
"active": false
},
{
"url": "http://192.168.0.139:8080/v1/admin/pages?page=1",
"label": "1",
"active": true
},
{
"url": null,
"label": "التالي »",
"active": false
}
],
"next_page_url": null,
"path": "http://192.168.0.139:8080/v1/admin/pages",
"per_page": 10,
"prev_page_url": null,
"to": 6,
"total": 6,
"pages": [
{
"id": "d75c1c50-b5aa-11ed-8740-3b6fbf0f3645",
"title": "الوظائف",
"link": "/pages/jobs",
"can_modified": false
},
{
"id": "c1355030-7463-11ed-a0e4-95352d757486",
"title": "أهداف 2023",
"link": "/pages/2023Goals",
"can_modified": false
},
{
"id": "ef93c3c0-2db1-11ed-bb79-cf4ac7d754e4",
"title": "عن الدكتورة سمية",
"link": "/pages/about",
"can_modified": true
},
{
"id": "06622f80-198b-11ed-a194-ef0f852701eb",
"title": "الشروط والأحكام و سياسة الخصوصية",
"link": "/pages/terms-and-conditions-with-privacy-policy",
"can_modified": true
},
{
"id": "44be7620-fc64-11ec-ac0a-25b84d224296",
"title": "أحداث ألشهر",
"link": "/pages/privacy-policy",
"can_modified": true
},
{
"id": "44ba88e0-fc64-11ec-bef3-07e57efefd48",
"title": "قاموس الوعي",
"link": "/pages/awareness-dictionary",
"can_modified": false
}
]
},
"status_code": 200
}
Get Page Details
GET /v1/admin/pages/{id}
Returns details of a specific page.
Response
{
"success": true,
"message": "تم جلب البيانات بنجاح.",
"data": {
"id": "d75c1c50-b5aa-11ed-8740-3b6fbf0f3645",
"title": "الوظائف",
"description": "<p><br></p><p><div class=\"powr-form-builder\" id=\"282c8003_1677396973\"></div><script src=\"https://www.powr.io/powr.js?platform=html\"></script></p>",
"type": "editor",
"key": "jobs",
"link": "/pages/jobs",
"priority": 1,
"can_modified": false,
"logged_in_only": false,
"is_active": false
},
"status_code": 200
}
Create Page
POST /v1/admin/pages
Creates a new page.
Request Body
| Parameter | Type | Description | Validation Rules |
|---|---|---|---|
title | string | Page title | Required, min: 3, max: 255 |
type | string | Page type | Required, values: editor,code |
description | string | Page description | Required with type, min: 3 |
key | string | Unique identifier | Required, min: 3, max: 255, unique |
meta | object | Additional metadata | Optional |
priority | integer | Display priority | Optional, greater than 0 |
can_modified | boolean | Allow modifications | Required, values: true/false |
logged_in_only | boolean | Restrict to logged in users | Required, values: true/false |
is_active | boolean | Page active status | Required, values: true/false |
Response
{
"success": true,
"message": "تم حفظ البيانات بنجاح.",
"data": {
"id": "ec08ee40-058c-11f0-a2be-b7740d702c50",
"title": "show-page123",
"description": "<p class=\"ql-align-right\"><div class=\"powr-form-builder\" id=\"282c8003_1677396973\"></div><script src=\"https://www.powr.io/powr.js?platform=html\"></script></p>",
"type": "code",
"key": "omar123456789",
"link": "/pages/omar123456789",
"priority": "25",
"can_modified": false,
"logged_in_only": true,
"is_active": true
},
"status_code": 200
}
Update Page
PATCH /v1/admin/pages/{id}
Updates an existing page.
Request Body
| Parameter | Type | Description | Validation Rules |
|---|---|---|---|
title | string | Page title | min: 3, max: 255 |
type | string | Page type | values: editor,code |
description | string | Page description | Required with type, min: 3 |
key | string | Unique identifier | min: 3, max: 255, unique |
meta | object | Additional metadata | Optional |
priority | integer | Display priority | greater than 0 |
can_modified | boolean | Allow modifications | values: true/false |
logged_in_only | boolean | Restrict to logged in users | values: true/false |
is_active | boolean | Page active status | values: true/false |
Response
{
"success": true,
"message": "تم تحديث البيانات بنجاح.",
"data": {
"id": "010b9d70-058d-11f0-85a6-5df62c816d76",
"title": "show-page1",
"description": "<p class=\"ql-align-right\"><div class=\"powr-form-builder\" id=\"282c8003_1677396973\"></div><script src=\"https://www.powr.io/powr.js?platform=html\"></script></p>",
"type": "code",
"key": "omar1234567892",
"link": "/pages/omar1234567892",
"priority": 25,
"can_modified": true,
"logged_in_only": true,
"is_active": true
},
"status_code": 200
}
Delete Pages
DELETE /v1/admin/pages
Deletes multiple pages by their IDs.
Request Body
| Parameter | Type | Description | Validation Rules |
|---|---|---|---|
ids | array | Array of page IDs to delete | Required |
ids.* | string | Page UUID | Required, UUID format |
Response
{
"success": true,
"message": "تم حذف البيانات بنجاح.",
"data": null,
"status_code": 200
}
Duplicate Pages
POST /v1/admin/pages/duplicate
Creates copies of existing pages.
Request Body
| Parameter | Type | Description | Validation Rules |
|---|---|---|---|
ids | array | Array of page IDs to duplicate | Required |
ids.* | string | Page UUID | Required, UUID format |
Response
{
"success": true,
"message": "تم حفظ البيانات بنجاح.",
"data": null,
"status_code": 200
}
Notes
- The list endpoint excludes pages with key 'monthly-events'
- Results are sorted by creation date in descending order by default
- Pages marked with
can_modified: falsecannot be deleted - When duplicating a page:
- Title is prefixed with "نسخة من"
- Key is prefixed with "old-" and suffixed with "-copy"
- The copy is set to inactive by default
- The copy is always modifiable (
can_modified: true) - Priority is set to 100