├── composer.json ├── config └── jira.php └── src ├── Exceptions └── ConfigIncomplete.php ├── Facades └── Jira.php └── ServiceProvider.php /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "devmoath/jira-laravel", 3 | "description": "Jira PHP for Laravel is a supercharged PHP API client that allows you to interact with the Jira API and the Service Desk API", 4 | "keywords": [ 5 | "laravel", 6 | "php", 7 | "jira", 8 | "sdk", 9 | "service-desk", 10 | "api", 11 | "client" 12 | ], 13 | "license": "MIT", 14 | "authors": [ 15 | { 16 | "name": "Moath Alhajri", 17 | "email": "moath.alhajrii@gmail.com" 18 | } 19 | ], 20 | "require": { 21 | "php": "^8.1.0", 22 | "laravel/framework": "^9.0|^10.0|^11.0", 23 | "devmoath/jira-php": "0.*" 24 | }, 25 | "require-dev": { 26 | "laravel/pint": "^1.2.0", 27 | "pestphp/pest": "^2.0.0", 28 | "mockery/mockery": "^1.6", 29 | "phpstan/extension-installer": "^1.2", 30 | "phpstan/phpstan": "^1.8.6", 31 | "phpstan/phpstan-strict-rules": "^1.4", 32 | "symfony/var-dumper": "^6.0|^7.0" 33 | }, 34 | "autoload": { 35 | "psr-4": { 36 | "Jira\\Laravel\\": "src/" 37 | } 38 | }, 39 | "autoload-dev": { 40 | "psr-4": { 41 | "Tests\\": "tests/" 42 | } 43 | }, 44 | "minimum-stability": "dev", 45 | "prefer-stable": true, 46 | "config": { 47 | "sort-packages": true, 48 | "preferred-install": "dist", 49 | "allow-plugins": { 50 | "pestphp/pest-plugin": true, 51 | "phpstan/extension-installer": true 52 | } 53 | }, 54 | "extra": { 55 | "laravel": { 56 | "providers": [ 57 | "Jira\\Laravel\\ServiceProvider" 58 | ] 59 | } 60 | }, 61 | "scripts": { 62 | "lint": "pint --preset laravel -v --ansi", 63 | "test:lint": "pint --preset laravel --test -v --ansi", 64 | "test:types": "phpstan analyse --ansi", 65 | "test:unit": "pest --colors=always --min=100 --coverage", 66 | "test": [ 67 | "@test:lint", 68 | "@test:types", 69 | "@test:unit" 70 | ] 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /config/jira.php: -------------------------------------------------------------------------------- 1 | env('JIRA_USERNAME'), 14 | 'password' => env('JIRA_PASSWORD'), 15 | 'host' => env('JIRA_HOST'), 16 | 17 | ]; 18 | -------------------------------------------------------------------------------- /src/Exceptions/ConfigIncomplete.php: -------------------------------------------------------------------------------- 1 | app->singleton(Client::class, static function (): Client { 25 | $username = config('jira.username'); 26 | $password = config('jira.password'); 27 | $host = config('jira.host'); 28 | 29 | if (! is_string($username) || ! is_string($password) || ! is_string($host)) { 30 | throw ConfigIncomplete::create(); 31 | } 32 | 33 | return Jira::client($username, $password, $host); 34 | }); 35 | 36 | $this->app->alias(Client::class, 'jira'); 37 | } 38 | 39 | /** 40 | * Bootstrap any application services. 41 | * 42 | * @codeCoverageIgnore 43 | */ 44 | public function boot(): void 45 | { 46 | $this->publishes([ 47 | __DIR__.'/../config/jira.php' => config_path('jira.php'), 48 | ]); 49 | } 50 | 51 | /** 52 | * Get the services provided by the provider. 53 | * 54 | * @return array 55 | */ 56 | public function provides(): array 57 | { 58 | return [ 59 | Client::class, 60 | ]; 61 | } 62 | } 63 | --------------------------------------------------------------------------------