Skip to content

Commit

Permalink
Feature Refresh (#35)
Browse files Browse the repository at this point in the history
* WIP

* WIP

* WIP
  • Loading branch information
RhysLees authored Feb 9, 2024
1 parent f76257d commit bf9c079
Show file tree
Hide file tree
Showing 7 changed files with 150 additions and 31 deletions.
52 changes: 52 additions & 0 deletions .github/ISSUE_TEMPLATE/bug.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Bug Report
description: Report an Issue or Bug with the Package
title: "[Bug]: "
labels: ["bug"]
body:
- type: markdown
attributes:
value: |
We're sorry to hear you have a problem. Can you help us solve it by providing the following details.
- type: textarea
id: what-happened
attributes:
label: What happened?
description: What did you expect to happen?
placeholder: I cannot currently do X thing because when I do, it breaks X thing.
validations:
required: true

- type: input
id: package-version
attributes:
label: Package Version
description: What version of our Package are you running? Please be as specific as possible
placeholder: 2.0.0
validations:
required: true
- type: input
id: php-version
attributes:
label: PHP Version
description: What version of PHP are you running? Please be as specific as possible
placeholder: 8.2.0
validations:
required: true
- type: input
id: laravel-version
attributes:
label: Laravel Version
description: What version of Laravel are you running? Please be as specific as possible
placeholder: 9.0.0
validations:
required: true
- type: dropdown
id: operating-systems
attributes:
label: Which operating systems does with happen with?
description: You may select more than one.
multiple: true
options:
- macOS
- Windows
- Linux
15 changes: 6 additions & 9 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
blank_issues_enabled: false
contact_links:
- name: Ask a question
url: https://github.com/codebar-ag/laravel-zammad/issues/new
about: Ask the community for help
- name: Request a feature
url: https://github.com/codebar-ag/laravel-zammad/issues/new
about: Share ideas for new features
- name: Report a bug
url: https://github.com/codebar-ag/laravel-zammad/issues/new
about: Report a reproducable bug
- name: Questions & Feature Requests
url: https://github.com/codebar-ag/laravel-zammad/issues/new
about: Ask the community for help
- name: Report a security issue
url: https://github.com/codebar-ag/laravel-zammad/security/policy
about: Learn how to notify us for sensitive bugs
4 changes: 2 additions & 2 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
max-parallel: 1
matrix:
os: [ ubuntu-latest, windows-latest ]
php: [ 8.2 ]
php: [ 8.2, 8.3 ]
laravel: [ 10.* ]
stability: [ prefer-lowest, prefer-stable ]
include:
Expand Down Expand Up @@ -60,4 +60,4 @@ jobs:
name: Store report
retention-days: 1
path: |
./reports
./reports
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
.php_cs.cache
.php-cs-fixer.cache
.phpunit.result.cache
.phpunit.cache
.DS_STORE
build
composer.lock
Expand Down
76 changes: 73 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ See the documentation if you need further functionality. ⚠️

## 💡 What is Zammad?

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

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

```php
use CodebarAg\Zammad\Facades\Zammad;
```

```php
/**
* Get the current authenticated user.
*/

$user = Zammad::user()->me();
```

```php
/**
* Show a list of users.
*/

$users = Zammad::user()->list();
```

```php
/**
* Search a single user.
*/

$term = 'email:[email protected]';

$user = Zammad::user()->search($term);
```

```php
/**
* Show a user by id.
*/

$user = Zammad::user()->show(20);
```

```php
/**
* Create a new user.
*/

$data = [
'firstname' => 'Max',
'lastname' => 'Mustermann',
'email' => '[email protected]',
];

$user = (new Zammad())->user()->create($data);
```

```php
/**
* Update a existing user.
*/

$data = [
'firstname' => 'Max',
'lastname' => 'Mustermann',
];

$user = (new Zammad())->user()->update($id, $data);
```

```php
/**
* Delete a user by id.
*/

(new Zammad())->user()->delete(20);
```

```php
/**
* Search a user by email. If not found create a new user.
*/

$user = (new Zammad())->user()->searchOrCreateByEmail('[email protected]');
```

```php
/**
* Search a user by email. If not found create a new user with custom $data
*/

$data = [
$data = [
'firstname' => 'Max',
'lastname' => 'Mustermann',
'email' => '[email protected]',
Expand All @@ -136,32 +162,47 @@ $user = (new Zammad())->user()->searchOrCreateByEmail('[email protected]

```php
use CodebarAg\Zammad\Facades\Zammad;
```

```php
/**
* Show a list of tickets.
*/

$tickets = Zammad::ticket()->list();
```

```php
/**
* Search tickets which include following term.
*/

$term = 'Max Mustermann';

$tickets = Zammad::ticket()->search($term);
```

```php
/**
* Show a ticket by id (empty comments).
*/

$ticket = Zammad::ticket()->show(20);
```

```php
/**
* Show a ticket by id with comments.
*/

$ticket = Zammad::ticket()->showWithComments(20);
```

```php
/**
* Create a new ticket.
*/

$data = [
'title' => 'The application is not working',
'group' => 'Inbox',
Expand All @@ -180,31 +221,43 @@ $data = [
];

$ticket = (new Zammad())->ticket()->create($data);
```

```php
/**
* Delete a ticket by id.
*/

(new Zammad())->user()->delete(20);
```

### 💬 Comment Resource

```php
use CodebarAg\Zammad\Facades\Zammad;
```

```php
/**
* Show comments by ticket id
*/

$comments = Zammad::comment()->showByTicket(20);
```

```php
/**
* Show a comment by id.
*/

$comment = Zammad::comment()->show(20);
```

```php
/**
* Create a new comment.
*/

$data = [
'ticket_id' => 42,
'subject' => 'Login still not working',
Expand All @@ -220,23 +273,31 @@ $data = [
];

$comment = (new Zammad())->comment()->create($data);
```

```php
/**
* Delete a comment by id.
*/

(new Zammad())->comment()->delete(20);
```

### 🏠 Object Resource

```php
use CodebarAg\Zammad\Facades\Zammad;
```

```php
/**
* Show a list of objects.
*/

$objects = Zammad::object()->list();
```

```php
/**
* Create a object
*/
Expand All @@ -259,30 +320,39 @@ $objects = Zammad::object()->list();
];

$object = Zammad::object()->create($data);
```

```php
/**
* Update a object
*/


$object = Zammad::object()->update($id, $data);
```

```php
/**
* Show a object by id.
*/

$object = Zammad::object()->show(20);
```

```php
/**
* Execute database migrations
*/

(new Zammad())->object()->executeMigrations();
```

### 🧷 Attachment Resource

```php
use CodebarAg\Zammad\Facades\Zammad;
```

```php
/**
* Download attachment.
*/
Expand Down
Loading

0 comments on commit bf9c079

Please sign in to comment.