File tree Expand file tree Collapse file tree 1 file changed +28
-1
lines changed Expand file tree Collapse file tree 1 file changed +28
-1
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,34 @@ composer require treblle/treblle-api-tools-laravel
3434
3535## Usage
3636
37- Coming soon ...
37+ ### Headers
38+
39+ #### Authorization
40+
41+ You can use the Authorization Header can be used like the following:
42+
43+ ``` php
44+ use Treblle\Tools\Http\Enums\Headers\AuthScheme;
45+ use Treblle\Tools\Http\Headers\Authorization;
46+
47+ $auth = new Authorization(
48+ type: AuthScheme::BEARER,
49+ credentials: 'YOUR_API_TOKEN_HERE',
50+ );
51+
52+ // Turn the header into an array
53+ $array = $auth->toArray();
54+ //[
55+ // 'type' => AuthScheme::BEARER,
56+ // 'credentials' => 'YOUR_API_TOKEN_HERE'
57+ //]
58+
59+ // Turn the header into a header
60+ $header = $auth->toHeader();
61+ //[
62+ // 'Authorization' => 'Bearer YOUR_API_TOKEN_HERE',
63+ //]
64+ ```
3865
3966## Support
4067
You can’t perform that action at this time.
0 commit comments