Skip to main content
ADMIN role required — This endpoint requires administrator privileges. Non-admin users will receive a 403 Forbidden error.

Endpoint

GET /api/repair-request

Authentication

This endpoint requires a valid JWT Bearer token with ADMIN role.
Authorization: Bearer YOUR_JWT_TOKEN

Response

Returns a list of all repair requests ordered by ID in descending order (newest first).

Response Fields

success
boolean
required
Indicates if the request was successful
message
string
required
Success message
data
object
required

Examples

curl -X GET https://api.yourservice.com/api/repair-request \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Accept: application/json"

Response Example

{
  "success": true,
  "message": "All repair requests retrieved successfully",
  "data": {
    "repairRequests": [
      {
        "id": 1,
        "receipt_number": "RR-20260308143025123456789",
        "customer_name": "John Doe",
        "customer_phone": "+1234567890",
        "customer_email": "[email protected]",
        "article_name": "Laptop",
        "article_type": "Electronics",
        "article_brand": "Dell",
        "article_model": "XPS 15",
        "article_serialnumber": "SN123456",
        "article_accesories": "Charger, Case",
        "article_problem": "Screen not turning on",
        "repair_status": "in_progress",
        "repair_details": "Replacing LCD panel",
        "repair_price": "250.00",
        "received_at": "2026-03-08T14:30:25.000000Z",
        "repaired_at": null,
        "images": [
          {
            "id": 1,
            "path": "repair_requests/repair_request_image_RR-20260308143025123456789_1.jpg",
            "imageable_type": "App\\Models\\RepairRequest",
            "imageable_id": "RR-20260308143025123456789"
          }
        ],
        "created_at": "2026-03-08T14:30:25.000000Z",
        "updated_at": "2026-03-08T14:30:25.000000Z",
        "deleted_at": null
      }
    ]
  }
}

Error Responses

401 Unauthorized

{
  "success": false,
  "message": "Unauthenticated"
}

403 Forbidden

Returned when the authenticated user does not have ADMIN role.
{
  "success": false,
  "message": "This action is unauthorized"
}

Notes

  • The receipt_number is the unique identifier for repair requests, not the id
  • Results are ordered by ID in descending order (newest first)
  • Images are loaded with each repair request using eager loading
  • Soft-deleted records are excluded from results

Build docs developers (and LLMs) love