Skip to content

Commit 04256ee

Browse files
authored
Update README.md
1 parent b2c2117 commit 04256ee

File tree

1 file changed

+11
-14
lines changed

1 file changed

+11
-14
lines changed

README.md

+11-14
Original file line numberDiff line numberDiff line change
@@ -29,25 +29,19 @@ curl -sS https://getcomposer.org/installer | php
2929

3030
### 2. Add the Framework to Your Project
3131

32-
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-
4032
```json
4133
{
34+
"require": {
35+
"t045t/php-api": "dev-develop"
36+
},
4237
"repositories": [
4338
{
44-
"type": "git",
39+
"type": "vcs",
4540
"url": "https://github.com/DevT045T/php-api.git"
4641
}
4742
],
48-
"require": {
49-
"devt045t/php-api": "develop"
50-
}
43+
"minimum-stability": "dev",
44+
"prefer-stable": true
5145
}
5246
```
5347

@@ -89,12 +83,14 @@ $param1 = new ApiParameter();
8983
$param1
9084
->name('username')
9185
->required(true)
86+
->methods([HttpMethods::POST])
9287
->type(DataTypes::STRING);
9388

9489
$param2 = new ApiParameter();
9590
$param2
9691
->name('password')
9792
->required(true)
93+
->methods([HttpMethods::POST])
9894
->type(DataTypes::INT);
9995

10096
// Add parameters to API instance
@@ -203,6 +199,7 @@ The `ApiParameter` class helps you define the parameters for your API. Each para
203199
- **Name**: The name of the parameter (e.g., `username`, `age`).
204200
- **Required**: Whether the parameter is required for the request. Default is `false`.
205201
- **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`).
206203

207204
### Example of `ApiParameter`:
208205

@@ -211,7 +208,7 @@ use devt045t\ApiParameter;
211208
use devt045t\DataTypes;
212209

213210
$param = new ApiParameter();
214-
$param->name('username')->required(true)->type(DataTypes::STRING);
211+
$param->name('username')->required(true)->methods([HttpMethods::POST])->type(DataTypes::STRING);
215212
```
216213

217214
### Supported Data Types
@@ -241,4 +238,4 @@ This project is licensed under the **MIT License** - see the [LICENSE](LICENSE)
241238

242239
Feel free to fork this project, make improvements, and submit pull requests. Contributions are always welcome!
243240

244-
---
241+
---

0 commit comments

Comments
 (0)