Skip to content

Commit bf9c079

Browse files
authored
Feature Refresh (#35)
* WIP * WIP * WIP
1 parent f76257d commit bf9c079

File tree

7 files changed

+150
-31
lines changed

7 files changed

+150
-31
lines changed

.github/ISSUE_TEMPLATE/bug.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Bug Report
2+
description: Report an Issue or Bug with the Package
3+
title: "[Bug]: "
4+
labels: ["bug"]
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: |
9+
We're sorry to hear you have a problem. Can you help us solve it by providing the following details.
10+
- type: textarea
11+
id: what-happened
12+
attributes:
13+
label: What happened?
14+
description: What did you expect to happen?
15+
placeholder: I cannot currently do X thing because when I do, it breaks X thing.
16+
validations:
17+
required: true
18+
19+
- type: input
20+
id: package-version
21+
attributes:
22+
label: Package Version
23+
description: What version of our Package are you running? Please be as specific as possible
24+
placeholder: 2.0.0
25+
validations:
26+
required: true
27+
- type: input
28+
id: php-version
29+
attributes:
30+
label: PHP Version
31+
description: What version of PHP are you running? Please be as specific as possible
32+
placeholder: 8.2.0
33+
validations:
34+
required: true
35+
- type: input
36+
id: laravel-version
37+
attributes:
38+
label: Laravel Version
39+
description: What version of Laravel are you running? Please be as specific as possible
40+
placeholder: 9.0.0
41+
validations:
42+
required: true
43+
- type: dropdown
44+
id: operating-systems
45+
attributes:
46+
label: Which operating systems does with happen with?
47+
description: You may select more than one.
48+
multiple: true
49+
options:
50+
- macOS
51+
- Windows
52+
- Linux

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
blank_issues_enabled: false
22
contact_links:
3-
- name: Ask a question
4-
url: https://github.com/codebar-ag/laravel-zammad/issues/new
5-
about: Ask the community for help
6-
- name: Request a feature
7-
url: https://github.com/codebar-ag/laravel-zammad/issues/new
8-
about: Share ideas for new features
9-
- name: Report a bug
10-
url: https://github.com/codebar-ag/laravel-zammad/issues/new
11-
about: Report a reproducable bug
3+
- name: Questions & Feature Requests
4+
url: https://github.com/codebar-ag/laravel-zammad/issues/new
5+
about: Ask the community for help
6+
- name: Report a security issue
7+
url: https://github.com/codebar-ag/laravel-zammad/security/policy
8+
about: Learn how to notify us for sensitive bugs

.github/workflows/run-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
max-parallel: 1
1515
matrix:
1616
os: [ ubuntu-latest, windows-latest ]
17-
php: [ 8.2 ]
17+
php: [ 8.2, 8.3 ]
1818
laravel: [ 10.* ]
1919
stability: [ prefer-lowest, prefer-stable ]
2020
include:
@@ -60,4 +60,4 @@ jobs:
6060
name: Store report
6161
retention-days: 1
6262
path: |
63-
./reports
63+
./reports

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
.php_cs.cache
44
.php-cs-fixer.cache
55
.phpunit.result.cache
6+
.phpunit.cache
67
.DS_STORE
78
build
89
composer.lock

README.md

Lines changed: 73 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ See the documentation if you need further functionality. ⚠️
1414

1515
## 💡 What is Zammad?
1616

17-
Zammad is a web based open source helpdesk/customer support system with many
17+
Zammad is a web-based open source helpdesk/customer support system with many
1818
features to manage customer communication.
1919

2020
## 🛠 Requirements
@@ -65,65 +65,91 @@ can create your token. Be sure to activate all rights you need.
6565

6666
```php
6767
use CodebarAg\Zammad\Facades\Zammad;
68+
```
6869

70+
```php
6971
/**
7072
* Get the current authenticated user.
7173
*/
74+
7275
$user = Zammad::user()->me();
76+
```
7377

78+
```php
7479
/**
7580
* Show a list of users.
7681
*/
82+
7783
$users = Zammad::user()->list();
84+
```
7885

86+
```php
7987
/**
8088
* Search a single user.
8189
*/
90+
8291
$term = 'email:sebastian.fix@codebar.ch';
8392

8493
$user = Zammad::user()->search($term);
94+
```
8595

96+
```php
8697
/**
8798
* Show a user by id.
8899
*/
100+
89101
$user = Zammad::user()->show(20);
102+
```
90103

104+
```php
91105
/**
92106
* Create a new user.
93107
*/
108+
94109
$data = [
95110
'firstname' => 'Max',
96111
'lastname' => 'Mustermann',
97112
'email' => 'max.mustermann@codebar.ch',
98113
];
99114

100115
$user = (new Zammad())->user()->create($data);
116+
```
101117

118+
```php
102119
/**
103120
* Update a existing user.
104121
*/
122+
105123
$data = [
106124
'firstname' => 'Max',
107125
'lastname' => 'Mustermann',
108126
];
109127

110128
$user = (new Zammad())->user()->update($id, $data);
129+
```
111130

131+
```php
112132
/**
113133
* Delete a user by id.
114134
*/
135+
115136
(new Zammad())->user()->delete(20);
137+
```
116138

139+
```php
117140
/**
118141
* Search a user by email. If not found create a new user.
119142
*/
143+
120144
$user = (new Zammad())->user()->searchOrCreateByEmail('max.mustermann@codebar.ch');
145+
```
121146

147+
```php
122148
/**
123149
* Search a user by email. If not found create a new user with custom $data
124150
*/
125151

126-
$data = [
152+
$data = [
127153
'firstname' => 'Max',
128154
'lastname' => 'Mustermann',
129155
'email' => 'max.mustermann@codebar.ch',
@@ -136,32 +162,47 @@ $user = (new Zammad())->user()->searchOrCreateByEmail('max.mustermann@codebar.ch
136162

137163
```php
138164
use CodebarAg\Zammad\Facades\Zammad;
165+
```
139166

167+
```php
140168
/**
141169
* Show a list of tickets.
142170
*/
171+
143172
$tickets = Zammad::ticket()->list();
173+
```
144174

175+
```php
145176
/**
146177
* Search tickets which include following term.
147178
*/
179+
148180
$term = 'Max Mustermann';
149181

150182
$tickets = Zammad::ticket()->search($term);
183+
```
151184

185+
```php
152186
/**
153187
* Show a ticket by id (empty comments).
154188
*/
189+
155190
$ticket = Zammad::ticket()->show(20);
191+
```
156192

193+
```php
157194
/**
158195
* Show a ticket by id with comments.
159196
*/
197+
160198
$ticket = Zammad::ticket()->showWithComments(20);
199+
```
161200

201+
```php
162202
/**
163203
* Create a new ticket.
164204
*/
205+
165206
$data = [
166207
'title' => 'The application is not working',
167208
'group' => 'Inbox',
@@ -180,31 +221,43 @@ $data = [
180221
];
181222

182223
$ticket = (new Zammad())->ticket()->create($data);
224+
```
183225

226+
```php
184227
/**
185228
* Delete a ticket by id.
186229
*/
230+
187231
(new Zammad())->user()->delete(20);
188232
```
189233

190234
### 💬 Comment Resource
191235

192236
```php
193237
use CodebarAg\Zammad\Facades\Zammad;
238+
```
194239

240+
```php
195241
/**
196242
* Show comments by ticket id
197243
*/
244+
198245
$comments = Zammad::comment()->showByTicket(20);
246+
```
199247

248+
```php
200249
/**
201250
* Show a comment by id.
202251
*/
252+
203253
$comment = Zammad::comment()->show(20);
254+
```
204255

256+
```php
205257
/**
206258
* Create a new comment.
207259
*/
260+
208261
$data = [
209262
'ticket_id' => 42,
210263
'subject' => 'Login still not working',
@@ -220,23 +273,31 @@ $data = [
220273
];
221274

222275
$comment = (new Zammad())->comment()->create($data);
276+
```
223277

278+
```php
224279
/**
225280
* Delete a comment by id.
226281
*/
282+
227283
(new Zammad())->comment()->delete(20);
228284
```
229285

230286
### 🏠 Object Resource
231287

232288
```php
233289
use CodebarAg\Zammad\Facades\Zammad;
290+
```
234291

292+
```php
235293
/**
236294
* Show a list of objects.
237295
*/
296+
238297
$objects = Zammad::object()->list();
298+
```
239299

300+
```php
240301
/**
241302
* Create a object
242303
*/
@@ -259,30 +320,39 @@ $objects = Zammad::object()->list();
259320
];
260321

261322
$object = Zammad::object()->create($data);
323+
```
262324

325+
```php
263326
/**
264327
* Update a object
265328
*/
266329

267-
268330
$object = Zammad::object()->update($id, $data);
331+
```
269332

333+
```php
270334
/**
271335
* Show a object by id.
272336
*/
337+
273338
$object = Zammad::object()->show(20);
339+
```
274340

341+
```php
275342
/**
276343
* Execute database migrations
277344
*/
345+
278346
(new Zammad())->object()->executeMigrations();
279347
```
280348

281349
### 🧷 Attachment Resource
282350

283351
```php
284352
use CodebarAg\Zammad\Facades\Zammad;
353+
```
285354

355+
```php
286356
/**
287357
* Download attachment.
288358
*/

0 commit comments

Comments
 (0)