Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/kmvan/php-response


https://github.com/kmvan/php-response

Last synced: about 1 month ago
JSON representation

Awesome Lists containing this project

README

        

### INSTALL

```shell
composer require kmvan/response
```

### REQUIRED

- PHP 8.1 or later

### USAGE

```php
setStatus(404)
->end(); // exit

// 201 created
$res->setStatus(201)
->setData([ // output json
'name' => 'Jack',
])
->end(); // exit
```

### RECOMMEND

Good experience with `composer require kmvan/status-code` library.

```php
setStatus(StatusCode::OK) // http status code 200
->end();
```