You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To install the framework from GitHub, specify the `develop` branch. You can do this by running the following command:
33
-
34
-
```bash
35
-
composer require devt045t/php-api:develop
36
-
```
37
-
38
-
Alternatively, if the package is not listed on Packagist, you can add the GitHub repository manually in your `composer.json` under the `"repositories"` section:
39
-
40
32
```json
41
33
{
34
+
"require": {
35
+
"t045t/php-api": "dev-develop"
36
+
},
42
37
"repositories": [
43
38
{
44
-
"type": "git",
39
+
"type": "vcs",
45
40
"url": "https://github.com/DevT045T/php-api.git"
46
41
}
47
42
],
48
-
"require": {
49
-
"devt045t/php-api": "develop"
50
-
}
43
+
"minimum-stability": "dev",
44
+
"prefer-stable": true
51
45
}
52
46
```
53
47
@@ -89,12 +83,14 @@ $param1 = new ApiParameter();
89
83
$param1
90
84
->name('username')
91
85
->required(true)
86
+
->methods([HttpMethods::POST])
92
87
->type(DataTypes::STRING);
93
88
94
89
$param2 = new ApiParameter();
95
90
$param2
96
91
->name('password')
97
92
->required(true)
93
+
->methods([HttpMethods::POST])
98
94
->type(DataTypes::INT);
99
95
100
96
// Add parameters to API instance
@@ -203,6 +199,7 @@ The `ApiParameter` class helps you define the parameters for your API. Each para
203
199
-**Name**: The name of the parameter (e.g., `username`, `age`).
204
200
-**Required**: Whether the parameter is required for the request. Default is `false`.
205
201
-**Data Type**: The data type for the parameter (e.g., `string`, `integer`, `boolean`).
202
+
-**Methods**: The allowed HTTP methods for the parameter (e.g., `POST` or `GET`).
0 commit comments