1
- <img src =" https://banners.beyondco.de/Laravel%20Beekeeper.png?theme=light&packageManager=composer+require&packageName=codebar-ag%2Flaravel-beekeeper&pattern=circuitBoard &style=style_1&description=An+opinionated+way+to+integrate+Beekeeper+with+Laravel&md=1&showWatermark=0&fontSize=175px &images=photograph " >
1
+ <img src =" https://banners.beyondco.de/Laravel%20Beekeeper.png?theme=light&packageManager=composer+require&packageName=codebar-ag%2Flaravel-beekeeper&pattern=architect &style=style_1&description=An+opinionated+way+to+integrate+Beekeeper+with+Laravel&md=1&showWatermark=0&fontSize=100px &images=cloud " >
2
2
3
3
4
4
@@ -18,6 +18,11 @@ Beekeeper Api. It is used to query the most common endpoints.
18
18
* [ 🛠 Requirements] ( #-requirements )
19
19
* [ Installation] ( #installation )
20
20
* [ Usage] ( #usage )
21
+ * [ Get the connector] ( #get-the-connector )
22
+ * [ Get The Status Of The Authenticated User] ( #get-the-status-of-the-authenticated-user )
23
+ * [ List Artifacts] ( #list-artifacts )
24
+ * [ Upload A File] ( #upload-a-file )
25
+ * [ Create A Child To An Artifact] ( #create-a-child-to-an-artifact )
21
26
* [ DTO Showcase] ( #dto-showcase )
22
27
* [ Testing] ( #testing )
23
28
* [ Changelog] ( #changelog )
@@ -76,22 +81,95 @@ BEEKEEPER_CACHE_STORE=beekeeper
76
81
77
82
## Usage
78
83
84
+ ### Get the connector
85
+
86
+ ``` php
87
+ use CodebarAg\LaravelBeekeeper\Connectors\BeekeeperConnector;
88
+
89
+ // Using the env variables
90
+ $connector = new BeekeeperConnector;
91
+
92
+ // Passing the credentials manually
93
+ $connector = new BeekeeperConnector(
94
+ apiToken: $yourApiToken,
95
+ endpointPrefix: 'foobar.us',
96
+ );
97
+ ```
98
+
99
+ ### Get The Status Of The Authenticated User
100
+
101
+ ``` php
102
+ use CodebarAg\LaravelBeekeeper\Requests\GetStatusOfAuthenticatedUserRequest;
103
+
104
+ $response = $connector->send(new GetStatusOfAuthenticatedUserRequest);
105
+ ````
106
+
107
+ ### List Artifacts
108
+
109
+ ```php
110
+ use CodebarAg\LaravelBeekeeper\Requests\ListArtifacts;
111
+
112
+ $response = $connector->send(new ListArtifacts(
113
+ type: Type::FOLDER,
114
+ sort: Sort::NAME_ASC,
115
+ limit: 20,
116
+ ));
117
+ ```
118
+
119
+ ### Upload A File
120
+
121
+ ``` php
122
+ use CodebarAg\LaravelBeekeeper\Requests\UploadAFileRequest;
123
+
124
+ $fileContent = file_get_contents('path-to/foobar.pdf');
125
+ $fileName = 'foobar.pdf';
126
+
127
+ $response = $connector->send(new UploadAFileRequest(
128
+ fileContent: $fileContent,
129
+ fileName: $fileName,
130
+ ));
131
+ ```
132
+
133
+ ### Create A Child To An Artifact
134
+
135
+ ``` php
136
+ use CodebarAg\LaravelBeekeeper\Requests\CreateAChildToAnArtifact;
137
+ use CodebarAg\LaravelBeekeeper\Enums\Artifacts\Type;
138
+
139
+ $response = $connector->send(new CreateAChildToAnArtifact(
140
+ artifactId: '12345678-abcd-efgh-9012-de00edbf7b0b',
141
+ name: 'foobar.pdf',
142
+ type: Type::FILE,
143
+ parentId: '12345678-abcd-efgh-9012-de00edbf7b0b',
144
+ metadata: [
145
+ 'mimeType' => 'image/png',
146
+ 'url' => 'https://foobar.us.beekeeper.io/api/2/files/key/12345678-abcd-efgh-9012-de00edbf7b0b',
147
+ 'userId' => '12345678-abcd-efgh-9012-de00edbf7b0b',
148
+ 'key' => '12345678-abcd-efgh-9012-de00edbf7b0b',
149
+ 'id' => 12345678,
150
+ 'size' => 123456,
151
+ ],
152
+ adjustArtifactName: false,
153
+ expand: []
154
+ ));
155
+ ```
156
+
79
157
## DTO Showcase
80
158
81
159
``` php
82
160
CodebarAg\LaravelBeekeeper\Data\Artifacts\Artifact {
83
- +id: "12345678-abcd-efgh-9012-de00edbf7b0b" // string
84
- +tenantId: "12345" // string
85
- +name: "Documents" // string
86
- +type: CodebarAg\LaravelBeekeeper\Enums\Artifacts\Type // Type
87
- +parentId: null // string|null
88
- +metadata: Illuminate\Support\Collection // Collection
89
- +createdAt: Carbon\CarbonImmutable // CarbonImmutable
90
- +updatedAt: Carbon\CarbonImmutable // CarbonImmutable
91
- +breadcrumbs: Illuminate\Support\Collection // Collection
92
- +children: Illuminate\Support\Collection // Collection
93
- +acl: Illuminate\Support\Collection // Collection
94
- +filterData: Illuminate\Support\Collection // Collection
161
+ +id: "12345678-abcd-efgh-9012-de00edbf7b0b" // string
162
+ +tenantId: "12345" // string
163
+ +name: "Documents" // string
164
+ +type: CodebarAg\LaravelBeekeeper\Enums\Artifacts\Type // Type
165
+ +parentId: null // string|null
166
+ +metadata: Illuminate\Support\Collection // Collection
167
+ +createdAt: Carbon\CarbonImmutable // CarbonImmutable
168
+ +updatedAt: Carbon\CarbonImmutable // CarbonImmutable
169
+ +breadcrumbs: Illuminate\Support\Collection // Collection
170
+ +children: Illuminate\Support\Collection // Collection
171
+ +acl: Illuminate\Support\Collection // Collection
172
+ +filterData: Illuminate\Support\Collection // Collection
95
173
}
96
174
```
97
175
0 commit comments