Skip to content

Commit 3f9ca6f

Browse files
author
Morten Bak
committed
register the facade in the serviceprovider
1 parent 987fbf8 commit 3f9ca6f

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/QuickpayServiceProvider.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace Netbums\Quickpay;
44

5+
use Illuminate\Foundation\AliasLoader;
56
use Spatie\LaravelPackageTools\Commands\InstallCommand;
67
use Spatie\LaravelPackageTools\Package;
78
use Spatie\LaravelPackageTools\PackageServiceProvider;
@@ -34,13 +35,16 @@ public function boot(): void
3435
$this->publishes([
3536
__DIR__.'/../config/quickpay.php' => config_path('quickpay.php'),
3637
], 'laravel-quickpay-config');
38+
39+
$loader = AliasLoader::getInstance();
40+
$loader->alias('Quickpay', Facades\Quickpay::class);
3741
}
3842

3943
public function register(): void
4044
{
4145

4246
$this->app->singleton(\Netbums\Quickpay\Quickpay::class, function ($app) {
43-
return new Quickpay();
47+
return (new Quickpay())::api();
4448
});
4549

4650
}

src/Resources/Concerns/QuickpayApiConsumer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public function __construct(public QuickPay $client)
2222
* @throws CardNotAccepted
2323
* @throws QuickPayValidationError
2424
*/
25-
public function request(string $method, string $endpoint, array $data): array
25+
public function request(string $method, string $endpoint, array $data = []): array
2626
{
2727
$response = $this->client->request->$method($endpoint, $data);
2828

0 commit comments

Comments
 (0)