legacyver 2.1.8 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/legacyver-docs/OrderController.md +80 -0
- package/legacyver-docs/SUMMARY.md +1 -1
- package/legacyver-docs/index.md +4 -4
- package/package.json +1 -1
- package/legacyver-docs/components.md +0 -63
- package/nul +0 -1
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
## Overview
|
|
2
|
+
This is the `OrderController` class, responsible for handling CRUD (Create, Read, Update, Delete) operations on orders. It provides a RESTful API interface to interact with the order data.
|
|
3
|
+
|
|
4
|
+
## Functions
|
|
5
|
+
|
|
6
|
+
### index
|
|
7
|
+
#### Description
|
|
8
|
+
Returns a paginated list of orders.
|
|
9
|
+
#### Parameters
|
|
10
|
+
| Parameter | Type | Required |
|
|
11
|
+
| --- | --- | --- |
|
|
12
|
+
| `paginate` | int | - |
|
|
13
|
+
| `response` | object | - |
|
|
14
|
+
| `json` | function | - |
|
|
15
|
+
|
|
16
|
+
#### Return Value
|
|
17
|
+
A `JsonResponse` containing the paginated list of orders.
|
|
18
|
+
|
|
19
|
+
### store
|
|
20
|
+
#### Description
|
|
21
|
+
Creates a new order and returns its details.
|
|
22
|
+
#### Parameters
|
|
23
|
+
| Parameter | Type | Required |
|
|
24
|
+
| --- | --- | --- |
|
|
25
|
+
| `$request:StoreOrderRequest` | object | Yes |
|
|
26
|
+
|
|
27
|
+
#### Return Value
|
|
28
|
+
A `JsonResponse` with the created order data and HTTP status code 201.
|
|
29
|
+
|
|
30
|
+
### show
|
|
31
|
+
#### Description
|
|
32
|
+
Returns a single order by its ID.
|
|
33
|
+
#### Parameters
|
|
34
|
+
| Parameter | Type | Required |
|
|
35
|
+
| --- | --- | --- |
|
|
36
|
+
| `$id:int` | int | Yes |
|
|
37
|
+
|
|
38
|
+
#### Return Value
|
|
39
|
+
A `JsonResponse` containing the order details.
|
|
40
|
+
|
|
41
|
+
### update
|
|
42
|
+
#### Description
|
|
43
|
+
Updates an existing order.
|
|
44
|
+
#### Parameters
|
|
45
|
+
| Parameter | Type | Required |
|
|
46
|
+
| --- | --- | --- |
|
|
47
|
+
| `$request:UpdateOrderRequest` | object | Yes |
|
|
48
|
+
| `$id:int` | int | Yes |
|
|
49
|
+
|
|
50
|
+
#### Return Value
|
|
51
|
+
A `JsonResponse` with the updated order data.
|
|
52
|
+
|
|
53
|
+
### destroy
|
|
54
|
+
#### Description
|
|
55
|
+
Deletes an existing order.
|
|
56
|
+
#### Parameters
|
|
57
|
+
| Parameter | Type | Required |
|
|
58
|
+
| --- | --- | --- |
|
|
59
|
+
| `$id:int` | int | Yes |
|
|
60
|
+
|
|
61
|
+
#### Return Value
|
|
62
|
+
A `JsonResponse` with HTTP status code 204.
|
|
63
|
+
|
|
64
|
+
## Dependencies
|
|
65
|
+
|
|
66
|
+
* `App\Models\Order`
|
|
67
|
+
* `App\Models\User`
|
|
68
|
+
* `App\Http\Requests\StoreOrderRequest`
|
|
69
|
+
* `App\Http\Requests\UpdateOrderRequest`
|
|
70
|
+
* `App\Services\OrderService`
|
|
71
|
+
* `Illuminate\Http\JsonResponse`
|
|
72
|
+
|
|
73
|
+
## Usage Example
|
|
74
|
+
```php
|
|
75
|
+
$orderController = new OrderController();
|
|
76
|
+
$orders = $orderController->index(); // returns paginated list of orders
|
|
77
|
+
|
|
78
|
+
$order = $orderController->store(new StoreOrderRequest(['name' => 'New Order'])); // creates and returns order details
|
|
79
|
+
```
|
|
80
|
+
Note: The usage example is just a demonstration and should be replaced with actual usage scenarios.
|
package/legacyver-docs/index.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Controllers — Documentation
|
|
2
2
|
|
|
3
|
-
**Primary language:**
|
|
3
|
+
**Primary language:** php
|
|
4
4
|
**Total files:** 1
|
|
5
|
-
**Analyzed at:** 2026-02-22T03:
|
|
5
|
+
**Analyzed at:** 2026-02-22T03:45:37.186Z
|
|
6
6
|
|
|
7
7
|
## Files
|
|
8
8
|
|
|
9
|
-
- [
|
|
9
|
+
- [OrderController.php](OrderController.md)
|
|
10
10
|
|
|
11
11
|
## Dependency Graph
|
|
12
12
|
|
package/package.json
CHANGED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
## Overview
|
|
2
|
-
This file contains React components and a utility function for formatting currency. The components include a Button and a UserCard.
|
|
3
|
-
|
|
4
|
-
## Functions
|
|
5
|
-
### Button
|
|
6
|
-
The Button component is a React functional component that renders a button element.
|
|
7
|
-
#### Parameters
|
|
8
|
-
| Parameter | Type | Description |
|
|
9
|
-
| --- | --- | --- |
|
|
10
|
-
| label | string | The text to display on the button |
|
|
11
|
-
| onClick | () => void | The function to call when the button is clicked |
|
|
12
|
-
| disabled | boolean | Optional, whether the button is disabled |
|
|
13
|
-
| variant | 'primary' | 'secondary' | 'danger' | Optional, the style variant of the button |
|
|
14
|
-
#### Return Value
|
|
15
|
-
The Button component returns a JSX button element.
|
|
16
|
-
|
|
17
|
-
### UserCard
|
|
18
|
-
The UserCard component is a React functional component that fetches user data and displays it in a card.
|
|
19
|
-
#### Parameters
|
|
20
|
-
| Parameter | Type | Description |
|
|
21
|
-
| --- | --- | --- |
|
|
22
|
-
| userId | number | The ID of the user to fetch |
|
|
23
|
-
| onClose | () => void | The function to call when the close button is clicked |
|
|
24
|
-
#### Return Value
|
|
25
|
-
The UserCard component returns a JSX div element containing the user's data or a loading/error message.
|
|
26
|
-
|
|
27
|
-
### formatCurrency
|
|
28
|
-
The formatCurrency function formats a number as a currency string.
|
|
29
|
-
#### Parameters
|
|
30
|
-
| Parameter | Type | Description |
|
|
31
|
-
| --- | --- | --- |
|
|
32
|
-
| amount | number | The amount to format |
|
|
33
|
-
| currency | string | Optional, the currency to use (default: 'USD') |
|
|
34
|
-
#### Return Value
|
|
35
|
-
The formatCurrency function returns a string representing the formatted currency amount.
|
|
36
|
-
|
|
37
|
-
## Dependencies
|
|
38
|
-
* React
|
|
39
|
-
* Intl.NumberFormat
|
|
40
|
-
|
|
41
|
-
## Usage Example
|
|
42
|
-
No clear usage example is visible in the provided code. However, components can be used as follows:
|
|
43
|
-
```jsx
|
|
44
|
-
import { Button, UserCard, formatCurrency } from './components';
|
|
45
|
-
|
|
46
|
-
const App = () => {
|
|
47
|
-
const handleButtonClicked = () => {
|
|
48
|
-
console.log('Button clicked');
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
const handleUserCardClose = () => {
|
|
52
|
-
console.log('User card closed');
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
return (
|
|
56
|
-
<div>
|
|
57
|
-
<Button label="Click me" onClick={handleButtonClicked} />
|
|
58
|
-
<UserCard userId={1} onClose={handleUserCardClose} />
|
|
59
|
-
<p>Formatted currency: {formatCurrency(1000)}</p>
|
|
60
|
-
</div>
|
|
61
|
-
);
|
|
62
|
-
};
|
|
63
|
-
```
|
package/nul
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/usr/bin/bash: line 1: type: %USERPROFILE%\.legacyver\session.json: not found
|