Skip to content

Commit a7d92be

Browse files
committed
WIP
1 parent 4ef9ec9 commit a7d92be

40 files changed

+203
-209
lines changed

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
blank_issues_enabled: false
22
contact_links:
33
- name: Ask a question
4-
url: https://github.com/codebar-ag/laravel-zendesk/issues/new
4+
url: https://github.com/codebar-ag/laravel-bexio/issues/new
55
about: Ask the community for help
66
- name: Request a feature
7-
url: https://github.com/codebar-ag/laravel-zendesk/issues/new
7+
url: https://github.com/codebar-ag/laravel-bexio/issues/new
88
about: Share ideas for new features
99
- name: Report a bug
10-
url: https://github.com/codebar-ag/laravel-zendesk/issues/new
10+
url: https://github.com/codebar-ag/laravel-bexio/issues/new
1111
about: Report a reproducable bug

README.md

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
<img src="https://banners.beyondco.de/Laravel%20Zendesk.png?theme=light&packageManager=composer+require&packageName=codebar-ag%2Flaravel-zendesk&pattern=circuitBoard&style=style_2&description=A+Laravel+Zendesk+integration.&md=1&showWatermark=1&fontSize=150px&images=home&widths=500&heights=500">
1+
<img src="https://banners.beyondco.de/Laravel%20Bexio.png?theme=light&packageManager=composer+require&packageName=codebar-ag%2Flaravel-bexio&pattern=circuitBoard&style=style_2&description=A+Laravel+Bexio+integration.&md=1&showWatermark=1&fontSize=150px&images=home&widths=500&heights=500">
22

3-
[![Latest Version on Packagist](https://img.shields.io/packagist/v/codebar-ag/laravel-zendesk.svg?style=flat-square)](https://packagist.org/packages/codebar-ag/laravel-zendesk)
4-
[![Total Downloads](https://img.shields.io/packagist/dt/codebar-ag/laravel-zendesk.svg?style=flat-square)](https://packagist.org/packages/codebar-ag/laravel-zendesk)
5-
[![run-tests](https://github.com/codebar-ag/laravel-zendesk/actions/workflows/run-tests.yml/badge.svg)](https://github.com/codebar-ag/laravel-zendesk/actions/workflows/run-tests.yml)
6-
[![PHPStan](https://github.com/codebar-ag/laravel-zendesk/actions/workflows/phpstan.yml/badge.svg)](https://github.com/codebar-ag/laravel-zendesk/actions/workflows/phpstan.yml)
3+
[![Latest Version on Packagist](https://img.shields.io/packagist/v/codebar-ag/laravel-bexio.svg?style=flat-square)](https://packagist.org/packages/codebar-ag/laravel-bexio)
4+
[![Total Downloads](https://img.shields.io/packagist/dt/codebar-ag/laravel-bexio.svg?style=flat-square)](https://packagist.org/packages/codebar-ag/laravel-bexio)
5+
[![run-tests](https://github.com/codebar-ag/laravel-bexio/actions/workflows/run-tests.yml/badge.svg)](https://github.com/codebar-ag/laravel-bexio/actions/workflows/run-tests.yml)
6+
[![PHPStan](https://github.com/codebar-ag/laravel-bexio/actions/workflows/phpstan.yml/badge.svg)](https://github.com/codebar-ag/laravel-bexio/actions/workflows/phpstan.yml)
77

8-
This package was developed to give you a quick start to creating tickets via the Zendesk API.
8+
This package was developed to give you a quick start to creating tickets via the Bexio API.
99

10-
## 💡 What is Zendesk?
10+
## 💡 What is Bexio?
1111

12-
Zendesk is a cloud-based help desk management solution offering customizable tools to build customer service portals,
12+
Bexio is a cloud-based help desk management solution offering customizable tools to build customer service portals,
1313
knowledge base and online communities.
1414

1515
## 🛠 Requirements
1616

17-
| Package | PHP | Laravel | Zendesk |
17+
| Package | PHP | Laravel | Bexio |
1818
|-----------|-------|----------------|:---------:|
1919
| >v1.0 | >8.2 | > Laravel 10.0 ||
2020

@@ -33,39 +33,39 @@ The currently supported authentication methods are:
3333
You can install the package via composer:
3434

3535
```bash
36-
composer require codebar-ag/laravel-zendesk
36+
composer require codebar-ag/laravel-bexio
3737
```
3838

3939
Optionally, you can publish the config file with:
4040

4141
```bash
42-
php artisan vendor:publish --provider="CodebarAg\Zendesk\ZendeskServiceProvider" --tag="config"
42+
php artisan vendor:publish --provider="CodebarAg\Bexio\BexioServiceProvider" --tag="config"
4343
```
4444

4545
You can add the following env variables to your `.env` file:
4646

4747
```dotenv
48-
ZENDESK_SUBDOMAIN=your-subdomain #required
49-
ZENDESK_AUTHENTICATION_METHOD=token #default ['basic', 'token']
50-
ZENDESK_EMAIL_ADDRESS=test@example.com #required
51-
ZENDESK_API_TOKEN=your-api-token #required only for token authentication
52-
ZENDESK_API_PASSWORD=your-password #required only for basic authentication
48+
BEXIO_SUBDOMAIN=your-subdomain #required
49+
BEXIO_AUTHENTICATION_METHOD=token #default ['basic', 'token']
50+
BEXIO_EMAIL_ADDRESS=test@example.com #required
51+
BEXIO_API_TOKEN=your-api-token #required only for token authentication
52+
BEXIO_API_PASSWORD=your-password #required only for basic authentication
5353
```
5454

5555
`Note: We handle base64 encoding for you so you don't have to encode your credentials.`
5656

5757
You can retrieve your API token from
58-
your [Zendesk Dashboard](https://developer.zendesk.com/api-reference/introduction/security-and-auth/)
58+
your [Bexio Dashboard](https://developer.bexio.com/api-reference/introduction/security-and-auth/)
5959

6060
## Usage
6161

62-
To use the package, you need to create a ZendeskConnector instance.
62+
To use the package, you need to create a BexioConnector instance.
6363

6464
```php
65-
use CodebarAg\Zendesk\ZendeskConnector;
65+
use CodebarAg\Bexio\BexioConnector;
6666
...
6767

68-
$connector = new ZendeskConnector();
68+
$connector = new BexioConnector();
6969
````
7070

7171
### Requests
@@ -127,10 +127,10 @@ We provide DTOs for the following:
127127
#### Create a ticket
128128

129129
```php
130-
use CodebarAg\Zendesk\Requests\CreateSingleTicketRequest;
131-
use CodebarAg\Zendesk\DTOs\SingleTicketDTO;
132-
use CodebarAg\Zendesk\DTOs\CommentDTO;
133-
use CodebarAg\Zendesk\Enums\TicketPriority;
130+
use CodebarAg\Bexio\Requests\CreateSingleTicketRequest;
131+
use CodebarAg\Bexio\DTOs\SingleTicketDTO;
132+
use CodebarAg\Bexio\DTOs\CommentDTO;
133+
use CodebarAg\Bexio\Enums\TicketPriority;
134134
...
135135

136136
$ticketResponse = $connector->send(
@@ -161,7 +161,7 @@ $ticket = $ticketResponse->dto();
161161
#### List all tickets
162162

163163
```php
164-
use CodebarAg\Zendesk\Requests\AllTicketsRequest;
164+
use CodebarAg\Bexio\Requests\AllTicketsRequest;
165165
...
166166

167167
$listTicketResponse = $connector->send(new AllTicketsRequest());
@@ -171,7 +171,7 @@ $listTicketResponse->dto();
171171
#### Count all tickets
172172

173173
```php
174-
use CodebarAg\Zendesk\Requests\CountTicketsRequest;
174+
use CodebarAg\Bexio\Requests\CountTicketsRequest;
175175
...
176176

177177
$countTicketResponse = $connector->send(new CountTicketsRequest());
@@ -181,7 +181,7 @@ $countTicketResponse->dto();
181181
#### Show a ticket
182182

183183
```php
184-
use CodebarAg\Zendesk\Requests\ShowTicketRequest;
184+
use CodebarAg\Bexio\Requests\ShowTicketRequest;
185185
...
186186

187187
$ticketID = 1;
@@ -193,8 +193,8 @@ $showTicketResponse->dto();
193193
#### Upload an attachment
194194

195195
```php
196-
use CodebarAg\Zendesk\Requests\CreateAttachmentRequest;
197-
use CodebarAg\Zendesk\Requests\CreateSingleTicketRequest;
196+
use CodebarAg\Bexio\Requests\CreateAttachmentRequest;
197+
use CodebarAg\Bexio\Requests\CreateSingleTicketRequest;
198198
use Illuminate\Support\Facades\Storage;
199199

200200
$uploadResponse = $connector->send(

composer.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
2-
"name": "codebar-ag/laravel-zendesk",
3-
"description": "Zendesk integration with Laravel",
2+
"name": "codebar-ag/laravel-bexio",
3+
"description": "Bexio integration with Laravel",
44
"keywords": [
5-
"zendesk",
5+
"bexio",
66
"laravel",
77
"codebar-ag",
8-
"laravel-zendesk"
8+
"laravel-bexio"
99
],
10-
"homepage": "https://github.com/codebar-ag/laravel-zendesk",
10+
"homepage": "https://github.com/codebar-ag/laravel-bexio",
1111
"license": "MIT",
1212
"authors": [
1313
{
@@ -47,12 +47,12 @@
4747
},
4848
"autoload": {
4949
"psr-4": {
50-
"CodebarAg\\Zendesk\\": "src"
50+
"CodebarAg\\Bexio\\": "src"
5151
}
5252
},
5353
"autoload-dev": {
5454
"psr-4": {
55-
"CodebarAg\\Zendesk\\Tests\\": "tests"
55+
"CodebarAg\\Bexio\\Tests\\": "tests"
5656
}
5757
},
5858
"scripts": {
@@ -73,10 +73,10 @@
7373
"extra": {
7474
"laravel": {
7575
"providers": [
76-
"CodebarAg\\Zendesk\\ZendeskServiceProvider"
76+
"CodebarAg\\Bexio\\BexioServiceProvider"
7777
],
7878
"aliases": {
79-
"Flatfox": "CodebarAg\\Zendesk\\Facades\\Zendesk"
79+
"Bexio": "CodebarAg\\Bexio\\Facades\\Bexio"
8080
}
8181
}
8282
},

config/zendesk.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<?php
22

33
return [
4-
'subdomain' => env('ZENDESK_SUBDOMAIN'), // 'yoursubdomain'
4+
'subdomain' => env('BEXIO_SUBDOMAIN'), // 'yoursubdomain'
55

66
'auth' => [
7-
'method' => env('ZENDESK_AUTHENTICATION_METHOD', 'token'), // 'basic' or 'token'
8-
'email_address' => env('ZENDESK_EMAIL_ADDRESS'), // Used for both authentication methods
9-
'password' => env('ZENDESK_PASSWORD'), // Only used if 'basic' is selected as authentication method
10-
'api_token' => env('ZENDESK_API_TOKEN'), // Only used if 'apitoken' is selected as authentication method
7+
'method' => env('BEXIO_AUTHENTICATION_METHOD', 'token'), // 'basic' or 'token'
8+
'email_address' => env('BEXIO_EMAIL_ADDRESS'), // Used for both authentication methods
9+
'password' => env('BEXIO_PASSWORD'), // Only used if 'basic' is selected as authentication method
10+
'api_token' => env('BEXIO_API_TOKEN'), // Only used if 'apitoken' is selected as authentication method
1111
],
1212
];

phpunit.xml.dist

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
<junit outputFile="build/report.junit.xml"/>
1717
</logging>
1818
<php>
19-
<env name="ZENDESK_SUBDOMAIN" value=""/>
20-
<env name="ZENDESK_EMAIL_ADDRESS" value=""/>
21-
<env name="ZENDESK_API_TOKEN" value=""/>
19+
<env name="BEXIO_SUBDOMAIN" value=""/>
20+
<env name="BEXIO_EMAIL_ADDRESS" value=""/>
21+
<env name="BEXIO_API_TOKEN" value=""/>
2222
</php>
2323
<source>
2424
<include>

src/Bexio.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?php
2+
3+
namespace CodebarAg\Bexio;
4+
5+
class Bexio
6+
{
7+
}

src/ZendeskConnector.php renamed to src/BexioConnector.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
<?php
22

3-
namespace CodebarAg\Zendesk;
3+
namespace CodebarAg\Bexio;
44

55
use Saloon\Contracts\Authenticator;
66
use Saloon\Http\Auth\TokenAuthenticator;
77
use Saloon\Http\Connector;
88

9-
class ZendeskConnector extends Connector
9+
class BexioConnector extends Connector
1010
{
1111
public function resolveBaseUrl(): string
1212
{
13-
if (! config('zendesk.subdomain')) {
13+
if (! config('bexio.subdomain')) {
1414
throw new \Exception('No subdomain provided.', 500);
1515
}
1616

17-
return 'https://'.config('zendesk.subdomain').'.zendesk.com/api/v2';
17+
return 'https://'.config('bexio.subdomain').'.bexio.com/api/v2';
1818
}
1919

2020
protected function defaultHeaders(): array
@@ -34,29 +34,29 @@ protected function defaultAuth(): ?Authenticator
3434

3535
public function setAuth(): string
3636
{
37-
if (! config('zendesk.auth.method')) {
37+
if (! config('bexio.auth.method')) {
3838
throw new \Exception('No authentication method provided.', 500);
3939
}
4040

41-
if (! config('zendesk.auth.email_address')) {
41+
if (! config('bexio.auth.email_address')) {
4242
throw new \Exception('No email address provided.', 500);
4343
}
4444

45-
if (config('zendesk.auth.method') === 'basic' && ! config('zendesk.auth.password')) {
45+
if (config('bexio.auth.method') === 'basic' && ! config('bexio.auth.password')) {
4646
throw new \Exception('No password provided for basic authentication.', 500);
4747
}
4848

49-
if (config('zendesk.auth.method') === 'basic' && ! config('zendesk.auth.password')) {
49+
if (config('bexio.auth.method') === 'basic' && ! config('bexio.auth.password')) {
5050
throw new \Exception('No password provided for basic authentication.', 500);
5151
}
5252

53-
if (config('zendesk.auth.method') === 'token' && ! config('zendesk.auth.api_token')) {
53+
if (config('bexio.auth.method') === 'token' && ! config('bexio.auth.api_token')) {
5454
throw new \Exception('No API token provided for token authentication.', 500);
5555
}
5656

57-
return match (config('zendesk.auth.method')) {
58-
'basic' => config('zendesk.auth.email_address').':'.config('zendesk.auth.password'),
59-
'token' => config('zendesk.auth.email_address').'/token:'.config('zendesk.auth.api_token'),
57+
return match (config('bexio.auth.method')) {
58+
'basic' => config('bexio.auth.email_address').':'.config('bexio.auth.password'),
59+
'token' => config('bexio.auth.email_address').'/token:'.config('bexio.auth.api_token'),
6060
default => throw new \Exception('Invalid authentication method provided.', 500),
6161
};
6262
}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
<?php
22

3-
namespace CodebarAg\Zendesk;
3+
namespace CodebarAg\Bexio;
44

55
use Spatie\LaravelPackageTools\Package;
66
use Spatie\LaravelPackageTools\PackageServiceProvider;
77

8-
class ZendeskServiceProvider extends PackageServiceProvider
8+
class BexioServiceProvider extends PackageServiceProvider
99
{
1010
public function configurePackage(Package $package): void
1111
{
1212
$package
13-
->name('laravel-zendesk')
13+
->name('laravel-bexio')
1414
->hasConfigFile();
1515
}
1616
}

src/Dto/Tickets/AllTicketsDTO.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace CodebarAg\Zendesk\Dto\Tickets;
3+
namespace CodebarAg\Bexio\Dto\Tickets;
44

55
use Exception;
66
use Illuminate\Support\Arr;

src/Dto/Tickets/Attachments/AttachmentDTO.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?php
22

3-
namespace CodebarAg\Zendesk\Dto\Tickets\Attachments;
3+
namespace CodebarAg\Bexio\Dto\Tickets\Attachments;
44

5-
use CodebarAg\Zendesk\Enums\MalwareScanResult;
5+
use CodebarAg\Bexio\Enums\MalwareScanResult;
66
use Illuminate\Support\Arr;
77
use Spatie\LaravelData\Data;
88

src/Dto/Tickets/Attachments/ThumbnailDTO.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?php
22

3-
namespace CodebarAg\Zendesk\Dto\Tickets\Attachments;
3+
namespace CodebarAg\Bexio\Dto\Tickets\Attachments;
44

5-
use CodebarAg\Zendesk\Enums\MalwareScanResult;
5+
use CodebarAg\Bexio\Enums\MalwareScanResult;
66
use Illuminate\Support\Arr;
77
use Spatie\LaravelData\Data;
88

src/Dto/Tickets/Attachments/UploadDTO.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace CodebarAg\Zendesk\Dto\Tickets\Attachments;
3+
namespace CodebarAg\Bexio\Dto\Tickets\Attachments;
44

55
use Illuminate\Support\Arr;
66
use Illuminate\Support\Carbon;

src/Dto/Tickets/Comments/CommentDTO.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace CodebarAg\Zendesk\Dto\Tickets\Comments;
3+
namespace CodebarAg\Bexio\Dto\Tickets\Comments;
44

55
use Illuminate\Support\Arr;
66
use Illuminate\Support\Carbon;

src/Dto/Tickets/CountTicketsDTO.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace CodebarAg\Zendesk\Dto\Tickets;
3+
namespace CodebarAg\Bexio\Dto\Tickets;
44

55
use Illuminate\Support\Arr;
66
use Illuminate\Support\Carbon;

src/Dto/Tickets/SingleTicketDTO.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<?php
22

3-
namespace CodebarAg\Zendesk\Dto\Tickets;
3+
namespace CodebarAg\Bexio\Dto\Tickets;
44

5-
use CodebarAg\Zendesk\Dto\Tickets\Comments\CommentDTO;
6-
use CodebarAg\Zendesk\Enums\TicketPriority;
7-
use CodebarAg\Zendesk\Enums\TicketType;
5+
use CodebarAg\Bexio\Dto\Tickets\Comments\CommentDTO;
6+
use CodebarAg\Bexio\Enums\TicketPriority;
7+
use CodebarAg\Bexio\Enums\TicketType;
88
use Illuminate\Support\Arr;
99
use Illuminate\Support\Carbon;
1010
use Saloon\Http\Response;

src/Enums/MalwareScanResult.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace CodebarAg\Zendesk\Enums;
3+
namespace CodebarAg\Bexio\Enums;
44

55
enum MalwareScanResult: string
66
{

0 commit comments

Comments
 (0)