Skip to content

Commit bc4a568

Browse files
committed
chore: update readme
1 parent e4418f7 commit bc4a568

File tree

1 file changed

+10
-220
lines changed

1 file changed

+10
-220
lines changed

README.md

Lines changed: 10 additions & 220 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ fetch()->options(...);
3838
response()->json($res->data);
3939
```
4040

41+
*Fetch is still in its early stages and is being actively developed. If you have any issues or suggestions, please feel free to open an issue or a pull request.*
42+
4143
## Installation
4244

4345
You can quickly install leaf fetch with the Leaf CLI
@@ -52,240 +54,28 @@ Or with composer:
5254
composer require leafs/fetch
5355
```
5456

55-
## Options
56-
57-
This is the array which is used to construct the request to be sent. The available fields are:
58-
59-
```php
60-
[
61-
// `url` is the server URL that will be used for the request
62-
"url" => null,
63-
64-
// `method` is the request method to be used when making the request
65-
"method" => "GET", // default
66-
67-
// `baseURL` will be prepended to `url` unless `url` is absolute.
68-
// It can be convenient to set `baseURL` for an instance of axios to pass relative URLs
69-
// to methods of that instance.
70-
"baseUrl" => "",
71-
72-
// `transformRequest` allows changes to the request data before it is sent to the server
73-
// This is only applicable for request methods 'PUT', 'POST', 'PATCH' and 'DELETE'
74-
// The last function in the array must return a string or an instance of Buffer, ArrayBuffer,
75-
// FormData or Stream
76-
// You may modify the headers object.
77-
// "transformRequest" => function ($data, $headers) {
78-
// // Do whatever you want to transform the data
79-
80-
// return $data;
81-
// },
82-
83-
// `transformResponse` allows changes to the response data to be made before
84-
// it is passed to then/catch
85-
// "transformResponse" => function ($data) {
86-
// // Do whatever you want to transform the data
87-
88-
// return $data;
89-
// },
90-
91-
// `headers` are custom headers to be sent
92-
"headers" => [],
93-
94-
// `params` are the URL parameters to be sent with the request
95-
// Must be a plain object or a URLSearchParams object
96-
"params" => [],
97-
98-
// `paramsSerializer` is an optional function in charge of serializing `params`
99-
// (e.g. https://www.npmjs.com/package/qs, http://api.jquery.com/jquery.param/)
100-
// "paramsSerializer" => function ($params) {
101-
// return Qs.stringify($params, ["arrayFormat" => "brackets"]);
102-
// },
103-
104-
// `data` is the data to be sent as the request body
105-
// Only applicable for request methods 'PUT', 'POST', 'DELETE , and 'PATCH'
106-
// When no `transformRequest` is set, must be of one of the following types:
107-
// - string, plain object, ArrayBuffer, ArrayBufferView, URLSearchParams
108-
// - Browser "only" => FormData, File, Blob
109-
// - Node "only" => Stream, Buffer
110-
"data" => [],
111-
112-
// `timeout` specifies the number of seconds before the request times out.
113-
// If the request takes longer than `timeout`, the request will be aborted.
114-
"timeout" => 0, // default is `0` (no timeout)
115-
116-
// `withCredentials` indicates whether or not cross-site Access-Control requests
117-
// should be made using credentials
118-
"withCredentials" => false, // default
119-
120-
// `adapter` allows custom handling of requests which makes testing easier.
121-
// Return a promise and supply a valid response (see lib/adapters/README.md).
122-
// "adapter" => function ($config) {
123-
// /* ... */
124-
// },
125-
126-
// `auth` indicates that HTTP Basic auth should be used, and supplies credentials.
127-
// This will set an `Authorization` header, overwriting any existing
128-
// `Authorization` custom headers you have set using `headers`.
129-
// Please note that only HTTP Basic auth is configurable through this parameter.
130-
// For Bearer tokens and such, use `Authorization` custom headers instead.
131-
"auth" => [],
132-
133-
// `responseType` indicates the type of data that the server will respond with
134-
// options "are" => 'arraybuffer', 'document', 'json', 'text', 'stream'
135-
// browser "only" => 'blob'
136-
"responseType" => "json", // default
137-
138-
// `responseEncoding` indicates encoding to use for decoding responses (Node.js only)
139-
// "Note" => Ignored for `responseType` of 'stream' or client-side requests
140-
"responseEncoding" => "utf8", // default
141-
142-
// `xsrfCookieName` is the name of the cookie to use as a value for xsrf token
143-
"xsrfCookieName" => "XSRF-TOKEN", // default
144-
145-
// `xsrfHeaderName` is the name of the http header that carries the xsrf token value
146-
"xsrfHeaderName" => "X-XSRF-TOKEN", // default
147-
148-
// `onUploadProgress` allows handling of progress events for uploads
149-
// browser only
150-
// "onUploadProgress" => function ($progressEvent) {
151-
// // Do whatever you want with the native progress event
152-
// },
153-
154-
// `onDownloadProgress` allows handling of progress events for downloads
155-
// browser only
156-
// "onDownloadProgress" => function ($progressEvent) {
157-
// // Do whatever you want with the native progress event
158-
// },
159-
160-
// `maxContentLength` defines the max size of the http response content in bytes allowed in node.js
161-
"maxContentLength" => 2000,
162-
163-
// `maxBodyLength` (Node only option) defines the max size of the http request content in bytes allowed
164-
"maxBodyLength" => 2000,
165-
166-
// `validateStatus` defines whether to resolve or reject the promise for a given
167-
// HTTP response status code. If `validateStatus` returns `true` (or is set to `null`
168-
// or `undefined`), the promise will be resolved; otherwise, the promise will be
169-
// rejected.
170-
// "validateStatus" => function ($status) {
171-
// return $status >= 200 && $status < 300; // default
172-
// },
173-
174-
// `maxRedirects` defines the maximum number of redirects to follow in node.js.
175-
// If set to 0, no redirects will be followed.
176-
"maxRedirects" => 5, // default
177-
178-
// `socketPath` defines a UNIX Socket to be used in node.js.
179-
// e.g. '/var/run/docker.sock' to send requests to the docker daemon.
180-
// Only either `socketPath` or `proxy` can be specified.
181-
// If both are specified, `socketPath` is used.
182-
"socketPath" => null, // default
183-
184-
// `proxy` defines the hostname, port, and protocol of the proxy server.
185-
// You can also define your proxy using the conventional `http_proxy` and
186-
// `https_proxy` environment variables. If you are using environment variables
187-
// for your proxy configuration, you can also define a `no_proxy` environment
188-
// variable as a comma-separated list of domains that should not be proxied.
189-
// Use `false` to disable proxies, ignoring environment variables.
190-
// `auth` indicates that HTTP Basic auth should be used to connect to the proxy, and
191-
// supplies credentials.
192-
// This will set an `Proxy-Authorization` header, overwriting any existing
193-
// `Proxy-Authorization` custom headers you have set using `headers`.
194-
// If the proxy server uses HTTPS, then you must set the protocol to `https`.
195-
"proxy" => [],
196-
197-
// `decompress` indicates whether or not the response body should be decompressed
198-
// automatically. If set to `true` will also remove the 'content-encoding' header
199-
// from the responses objects of all decompressed responses
200-
// - Node only (XHR cannot turn off decompression)
201-
"decompress" => true, // default
202-
203-
// If false, fetch will try to parse json responses
204-
"rawResponse" => false,
205-
206-
// CURLOPT_SSL_VERIFYHOST accepts only 0 (false) or 2 (true).
207-
// Future versions of libcurl will treat values 1 and 2 as equals
208-
"verifyHost" => true, // default
209-
210-
"verifyPeer" => true, // default
211-
212-
// Set additional options for curl.
213-
"curl" => [],
214-
];
215-
```
216-
217-
## 💬 Stay In Touch
57+
## Stay In Touch
21858

21959
- [Twitter](https://twitter.com/leafphp)
22060
- [Join the forum](https://github.com/leafsphp/leaf/discussions/37)
22161
- [Chat on discord](https://discord.com/invite/Pkrm9NJPE3)
22262

223-
## 📓 Learning Leaf 3
63+
## Learning Leaf PHP
22464

22565
- Leaf has a very easy to understand [documentation](https://leafphp.dev) which contains information on all operations in Leaf.
22666
- You can also check out our [youtube channel](https://www.youtube.com/channel/UCllE-GsYy10RkxBUK0HIffw) which has video tutorials on different topics
227-
- We are also working on codelabs which will bring hands-on tutorials you can follow and contribute to.
67+
- You can also learn from [codelabs](https://leafphp.dev/codelabs/) and contribute as well.
22868

229-
## 😇 Contributing
69+
## Contributing
23070

23171
We are glad to have you. All contributions are welcome! To get started, familiarize yourself with our [contribution guide](https://leafphp.dev/community/contributing.html) and you'll be ready to make your first pull request 🚀.
23272

23373
To report a security vulnerability, you can reach out to [@mychidarko](https://twitter.com/mychidarko) or [@leafphp](https://twitter.com/leafphp) on twitter. We will coordinate the fix and eventually commit the solution in this project.
23474

235-
### Code contributors
236-
237-
<table>
238-
<tr>
239-
<td align="center">
240-
<a href="https://github.com/mychidarko">
241-
<img src="https://avatars.githubusercontent.com/u/26604242?v=4" width="120px" alt=""/>
242-
<br />
243-
<sub>
244-
<b>Michael Darko</b>
245-
</sub>
246-
</a>
247-
</td>
248-
</tr>
249-
</table>
250-
251-
## 🤩 Sponsoring Leaf
252-
253-
Your cash contributions go a long way to help us make Leaf even better for you. You can sponsor Leaf and any of our packages on [open collective](https://opencollective.com/leaf) or check the [contribution page](https://leafphp.dev/support/) for a list of ways to contribute.
254-
255-
And to all our existing cash/code contributors, we love you all ❤️
256-
257-
### Cash contributors
75+
## Sponsoring Leaf
25876

259-
<table>
260-
<tr>
261-
<td align="center">
262-
<a href="https://opencollective.com/aaron-smith3">
263-
<img src="https://images.opencollective.com/aaron-smith3/08ee620/avatar/256.png" width="120px" alt=""/>
264-
<br />
265-
<sub><b>Aaron Smith</b></sub>
266-
</a>
267-
</td>
268-
<td align="center">
269-
<a href="https://opencollective.com/peter-bogner">
270-
<img src="https://images.opencollective.com/peter-bogner/avatar/256.png" width="120px" alt=""/>
271-
<br />
272-
<sub><b>Peter Bogner</b></sub>
273-
</a>
274-
</td>
275-
<td align="center">
276-
<a href="#">
277-
<img src="https://images.opencollective.com/guest-32634fda/avatar.png" width="120px" alt=""/>
278-
<br />
279-
<sub><b>Vano</b></sub>
280-
</a>
281-
</td>
282-
</tr>
283-
</table>
77+
We are committed to keeping Leaf open-source and free, but maintaining and developing new features now requires significant time and resources. As the project has grown, so have the costs, which have been mostly covered by the team. To sustain and grow Leaf, we need your help to support full-time maintainers.
28478

285-
## 🤯 Links/Projects
79+
You can sponsor Leaf and any of our packages on [open collective](https://opencollective.com/leaf) or check the [contribution page](https://leafphp.dev/support/) for a list of ways to contribute.
28680

287-
- [Aloe CLI](https://leafphp.dev/aloe-cli/)
288-
- [Leaf Docs](https://leafphp.dev)
289-
- [Leaf MVC](https://mvc.leafphp.dev)
290-
- [Leaf API](https://api.leafphp.dev)
291-
- [Leaf CLI](https://cli.leafphp.dev)
81+
And to all our [existing cash/code contributors](https://leafphp.dev#sponsors), we love you all ❤️

0 commit comments

Comments
 (0)