Skip to content

Commit

Permalink
Register checkout service stubs
Browse files Browse the repository at this point in the history
  • Loading branch information
r-kujawa committed Apr 20, 2024
1 parent 9f372e5 commit 86700c7
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/CheckoutServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,12 @@ protected function registerPublishableAssets()
{
$this->publishes([
__DIR__ . '/../database/migrations/2024_01_01_000010_create_base_checkout_tables.php' => database_path('migrations/2024_01_01_000010_create_base_checkout_tables.php'),
], ['payavel', 'payavel-checkout', 'payavel-migrations']);
], ['payavel', 'payavel-checkout', 'payavel-migrations', 'payavel-checkout-migrations']);

$this->publishes([
__DIR__ . '/../stubs/checkout/service-requester.stub' => base_path('stubs/checkout/service-requester.stub'),
__DIR__ . '/../stubs/checkout/service-responder.stub' => base_path('stubs/checkout/service-responder.stub'),
], ['payavel', 'payavel-checkout', 'payavel-stubs', 'payavel-checkout-stubs']);
}

protected function registerCommands()
Expand Down
12 changes: 12 additions & 0 deletions src/Console/Commands/CheckoutInstall.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,16 @@ class CheckoutInstall extends Command
* @var string
*/
protected $description = 'Install the checkout service into the application.';

/**
* Execute the console command.
*
* @return void
*/
public function handle()
{
$this->call('vendor:publish', ['--tag' => 'payavel-checkout-stubs']);

return parent::handle();
}
}
10 changes: 10 additions & 0 deletions stubs/service-requester.stub
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

namespace App\Services\Checkout\Contracts;

use Payavel\Checkout\Contracts\CheckoutRequester as PayavelCheckoutRequester

interface CheckoutRequester extends PayavelCheckoutRequester
{
//
}
10 changes: 10 additions & 0 deletions stubs/service-responder.stub
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

namespace App\Services\Checkout\Contracts;

use Payavel\Checkout\Contracts\CheckoutResponder as PayavelCheckoutResponder;

interface CheckoutResponder extends PayavelCheckoutResponder
{
//
}

0 comments on commit 86700c7

Please sign in to comment.