Overview
Worker controllers handle day-to-day operations for technicians and workers. All routes require authentication and therole:worker,admin,developer middleware.
Orders
Manage service orders and repair requests.List Orders
Display paginated list of orders with search functionality.
auth, role:worker,admin,developer
Route Name: worker.orders
Query Parameters:
Search by order ID, technician name, customer name, equipment brand, or equipment model
- Returns view with orders (paginated, 18 per page)
- Includes customers, equipments, company technicians
- AI diagnostics information (plan, limits, usage)
App\Http\Controllers\Worker\OrderController@index
Source: routes/web.php:29
Create Order
Create a new service order with optional AI diagnosis.
auth, role:worker,admin,developer
Route Name: worker.orders.store
Request Parameters:
ID of the customer (must exist in customers table)
ID of the equipment (must exist in equipments table)
Name of assigned technician (max 255 characters)
User ID of assigned technician (must exist in users table)
Whether to request AI-powered diagnosis
Description of equipment symptoms (5-600 characters, required if request_ai_diagnosis is true)
Order status (pending, in_progress, waiting_parts, completed, cancelled, delivered)
Estimated repair cost (minimum 0)
- Redirects back with success message
- May include AI warning if diagnosis quota exceeded
StoreOrderRequest
Controller: App\Http\Controllers\Worker\OrderController@store
Source: routes/web.php:30
Update Order Status
Update the status of an existing order.
auth, role:worker,admin,developer
Route Name: worker.orders.status
URL Parameters:
Order ID
New order status (pending, in_progress, waiting_parts, completed, cancelled, delivered)
- Redirects back with success message
UpdateOrderStatusRequest
Controller: App\Http\Controllers\Worker\OrderController@updateStatus
Source: routes/web.php:31
AI Diagnosis
Request AI diagnosis for equipment (currently disabled - use request_ai_diagnosis flag when creating order).
auth, role:worker,admin,developer
Route Name: worker.orders.diagnose
Request Parameters:
ID of equipment to diagnose
Equipment symptoms (5-600 characters)
- Returns JSON error (422) indicating direct diagnosis is disabled
- Users should use “request_ai_diagnosis” flag when creating orders instead
App\Http\Controllers\Worker\OrderController@diagnose
Source: routes/web.php:32
Customers
Manage customer records.List Customers
Display paginated list of customers.
auth, role:worker,admin,developer
Route Name: worker.customers
Query Parameters:
Search by customer name, email, or phone
- Returns view with customers (paginated, 20 per page)
- Filtered by company (except for developers)
App\Http\Controllers\Worker\CustomerController@index
Source: routes/web.php:34
Create Customer
Register a new customer.
auth, role:worker,admin,developer
Route Name: worker.customers.store
Request Parameters:
Customer full name (max 255 characters)
Customer email address (max 255 characters)
Customer phone number (max 50 characters)
Customer address (max 255 characters)
- Redirects back with success message
- Customer is automatically assigned to user’s company
StoreCustomerRequest
Controller: App\Http\Controllers\Worker\CustomerController@store
Source: routes/web.php:35
Equipment
Manage customer equipment records.List Equipment
Display paginated list of equipment.
auth, role:worker,admin,developer
Route Name: worker.equipments
Query Parameters:
Search by brand, model, type, or customer name
- Returns view with equipment (paginated, 18 per page)
- Includes associated customers
- Filtered by company (except for developers)
App\Http\Controllers\Worker\EquipmentController@index
Source: routes/web.php:37
Create Equipment
Register new equipment for a customer.
auth, role:worker,admin,developer
Route Name: worker.equipments.store
Request Parameters:
Customer who owns the equipment (must exist and belong to user’s company)
Equipment type (e.g., “Refrigerator”, “Washing Machine”) - max 100 characters
Equipment brand (max 100 characters)
Equipment model number (max 150 characters)
Equipment serial number (max 150 characters)
- Redirects back with success message
- Equipment is automatically assigned to customer’s company
StoreEquipmentRequest
Controller: App\Http\Controllers\Worker\EquipmentController@store
Source: routes/web.php:38
Inventory
Manage inventory items and stock levels. Requiresmodule_access:inventory middleware.
List Inventory Items
Display inventory items with stock movements and alerts.
auth, role:worker,admin,developer, module_access:inventory
Route Name: worker.inventory
Query Parameters:
Search by item name or internal code
- Returns view with inventory items (paginated, 20 per page)
- Recent stock movements (last 12)
- Low stock items and notifications
- Filtered by company
App\Http\Controllers\Worker\InventoryController@index
Source: routes/web.php:42-44
Create Inventory Item
Add a new item to inventory.
auth, role:worker,admin,developer, module_access:inventory
Route Name: worker.inventory.store
Request Parameters:
Item name (max 180 characters)
Unique internal code (max 120 characters, unique per company)
Initial stock quantity (0-1,000,000)
Alert threshold for low stock (0-1,000,000)
Whether item can be sold
Sale price (required if is_sale_enabled is true, max 99,999,999.99)
- Redirects back with success message
- Item is assigned to user’s company
StoreInventoryItemRequest
Controller: App\Http\Controllers\Worker\InventoryController@store
Source: routes/web.php:45-47
Adjust Stock
Add or remove stock for an inventory item.
auth, role:worker,admin,developer, module_access:inventory
Route Name: worker.inventory.stock
URL Parameters:
Inventory item ID
Type of stock movement: “addition” or “removal”
Quantity to add or remove (1-1,000,000)
Notes about the movement (max 255 characters)
- Redirects back with success message
- Creates inventory movement record
AdjustInventoryStockRequest
Controller: App\Http\Controllers\Worker\InventoryController@adjustStock
Source: routes/web.php:48-50
Delete Inventory Item
Remove an item from inventory.
auth, role:worker,admin,developer, module_access:inventory
Route Name: worker.inventory.destroy
URL Parameters:
Inventory item ID
- Redirects back with success message
App\Http\Controllers\Worker\InventoryController@destroy
Source: routes/web.php:51-53
Billing
Generate invoices and quotes. Requiresmodule_access:billing middleware.
List Billing Documents
Display list of billing documents (invoices and quotes).
auth, role:worker,admin,developer, module_access:billing
Route Name: worker.billing
Response:
- Returns view with billing documents (paginated, 20 per page)
- Includes customers and inventory items for document creation
- Company information
- Available order statuses
App\Http\Controllers\Worker\BillingController@index
Source: routes/web.php:54-56
Create Billing Document
Generate a new invoice or quote.
auth, role:worker,admin,developer, module_access:billing
Route Name: worker.billing.store
Request Parameters:
Type of document: “quote” or “invoice”
Document source: “repair”, “sale”, or “mixed”
Customer type: “registered” or “walk_in”
Registered customer ID (required if customer_mode is “registered”)
Walk-in customer name (required if customer_mode is “walk_in”, max 180 characters)
Tax handling: “included” or “excluded”
Document notes (max 2000 characters)
Array of line items (minimum 1 item)
Item type: “service” or “product”
Item description (max 255 characters)
Item quantity (0.01-999,999)
Price per unit (0-99,999,999.99)
Link to inventory item
Link to service order
- Redirects to document detail page
- Success message
StoreBillingDocumentRequest
Controller: App\Http\Controllers\Worker\BillingController@store
Source: routes/web.php:57-59
View Billing Document
Display full details of a billing document.
auth, role:worker,admin,developer, module_access:billing
Route Name: worker.billing.show
URL Parameters:
Billing document ID
- Returns view with complete document details
- Includes all line items with inventory and order links
- Customer and company information
App\Http\Controllers\Worker\BillingController@show
Source: routes/web.php:63-65
Download PDF
Download billing document as PDF.
auth, role:worker,admin,developer, module_access:billing
Route Name: worker.billing.pdf
URL Parameters:
Billing document ID
- Downloads PDF file named with document number
- A4 paper size
App\Http\Controllers\Worker\BillingController@pdf
Source: routes/web.php:66-68
Get Customer Services
Retrieve all service orders for a customer (JSON endpoint).
auth, role:worker,admin,developer, module_access:billing
Route Name: worker.billing.customer-services
URL Parameters:
Customer ID
App\Http\Controllers\Worker\BillingController@customerServices
Source: routes/web.php:60-62