Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable the Laravel Provider in SDK #41

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .speakeasy/gen.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ management:
docVersion: 0.0.1
speakeasyVersion: 1.418.4
generationVersion: 2.438.3
releaseVersion: 0.8.2
configChecksum: 723d6a9311351b6a69996e0301c795f8
releaseVersion: 0.8.4
configChecksum: 1ff3777354290bd90e0d0494e686f4ad
repoURL: https://github.com/dubinc/dub-php.git
installationURL: https://github.com/dubinc/dub-php
published: true
Expand All @@ -32,6 +32,7 @@ generatedFiles:
- CONTRIBUTING.md
- USAGE.md
- composer.json
- config/services.php
- docs/Models/Components/AnalyticsBrowsers.md
- docs/Models/Components/AnalyticsCities.md
- docs/Models/Components/AnalyticsCitiesCountry.md
Expand Down Expand Up @@ -439,6 +440,7 @@ generatedFiles:
- src/Models/Operations/UpdateWorkspaceResponse.php
- src/Models/Operations/UpsertLinkRequestBody.php
- src/Models/Operations/UpsertLinkResponse.php
- src/PackageServiceProvider.php
- src/QRCodes.php
- src/SDKConfiguration.php
- src/Tags.php
Expand Down
6 changes: 3 additions & 3 deletions .speakeasy/gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ generation:
auth:
oAuth2ClientCredentialsEnabled: true
php:
version: 0.8.2
version: 0.8.4
clientServerStatusCodesAsErrors: true
flattenGlobalSecurity: true
imports:
Expand All @@ -25,8 +25,8 @@ php:
webhooks: Models/Webhooks
inputModelSuffix: input
laravelServiceProvider:
enabled: false
svcName: openapi
enabled: true
svcName: dub
maxMethodParams: 4
methodArguments: infer-optional-args
namespace: Dub
Expand Down
11 changes: 5 additions & 6 deletions .speakeasy/workflow.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,18 @@ speakeasyVersion: 1.418.4
sources:
dub:
sourceNamespace: dub
sourceRevisionDigest: sha256:d28f693d697cc9d7457d69e7a611db5bde897f5f30b8eb38a3c37df0fda4e926
sourceBlobDigest: sha256:eb6f87b3a530aa265d333302f91d616540dbf54790e4eabd2d287b764f06e3de
sourceRevisionDigest: sha256:ced3fbaf630c233debd62c8ba667bbda2d67d19f47e5fb975b84c8579c488dd2
sourceBlobDigest: sha256:7e6b178675a2242610dc797bdd1c1987d5cc7a4954cef4d675a2a4783a3e2d30
tags:
- latest
- main
targets:
my-first-target:
source: dub
sourceNamespace: dub
sourceRevisionDigest: sha256:d28f693d697cc9d7457d69e7a611db5bde897f5f30b8eb38a3c37df0fda4e926
sourceBlobDigest: sha256:eb6f87b3a530aa265d333302f91d616540dbf54790e4eabd2d287b764f06e3de
sourceRevisionDigest: sha256:ced3fbaf630c233debd62c8ba667bbda2d67d19f47e5fb975b84c8579c488dd2
sourceBlobDigest: sha256:7e6b178675a2242610dc797bdd1c1987d5cc7a4954cef4d675a2a4783a3e2d30
codeSamplesNamespace: code-samples-php-my-first-target
codeSamplesRevisionDigest: sha256:e3c5beda98d8af0f477fb2ed7d05936618f7c474ffb70453b3d32ad4f76562c7
codeSamplesRevisionDigest: sha256:a0ebe9c70db280258be6e8631bf5582acc5afab1c8a4812372c7e6b7ddf64393
workflow:
workflowVersion: 1.0.0
speakeasyVersion: latest
Expand Down
10 changes: 9 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
"phpstan/phpstan": "^1.12",
"phpunit/phpunit": "^10",
"rector/rector": "^0.19",
"roave/security-advisories": "dev-latest"
"roave/security-advisories": "dev-latest",
"orchestra/testbench": "^9.4"
},
"minimum-stability": "stable",
"prefer-stable": true,
Expand All @@ -29,6 +30,13 @@
"classmap-authoritative": true,
"sort-packages": true
},
"extra": {
"laravel": {
"providers": [
"Dub\\PackageServiceProvider"
]
}
},
"scripts": {
"test": [
"./vendor/bin/phpunit --testdox --display-warnings --colors=always"
Expand Down
12 changes: 12 additions & 0 deletions config/services.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

/**
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/

return [
'dub' => [
'token' => env('TOKEN')
],
];

36 changes: 36 additions & 0 deletions src/PackageServiceProvider.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php

/**
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/


declare(strict_types=1);

namespace Dub;


use Illuminate\Contracts\Support\DeferrableProvider;
use Illuminate\Support\ServiceProvider;

final class PackageServiceProvider extends ServiceProvider implements DeferrableProvider
{
public function boot(): void
{
$this->mergeConfigFrom(
__DIR__.'/../config/services.php',
'services',
);
}

public function register(): void
{
$security = config('services.dub.token');
$this->app->singleton(
abstract: Dub::class,
concrete: fn (): Dub => Dub::builder()->setSecurity(
$security
)->build(),
);
}
}
4 changes: 2 additions & 2 deletions src/SDKConfiguration.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ class SDKConfiguration

public string $openapiDocVersion = '0.0.1';

public string $sdkVersion = '0.8.2';
public string $sdkVersion = '0.8.4';

public string $genVersion = '2.438.3';

public string $userAgent = 'speakeasy-sdk/php 0.8.2 2.438.3 0.0.1 dub/dub-php';
public string $userAgent = 'speakeasy-sdk/php 0.8.4 2.438.3 0.0.1 dub/dub-php';

public function getServerUrl(): string
{
Expand Down