Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
Signed-off-by: ninjaparade <[email protected]>
  • Loading branch information
ninjaparade committed Dec 9, 2023
1 parent ddac311 commit 08bb991
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Models/Casts/StripInvoiceSettingCast.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace Ninjaparade\StripeData\Models\Casts;

use Ninjaparade\StripeData\Data\Response\Customers\StripeCustomerInvoiceSettingData;
use Illuminate\Contracts\Database\Eloquent\CastsAttributes;
use Illuminate\Database\Eloquent\Model;
use Ninjaparade\StripeData\Data\Response\StripeCustomerInvoiceSettingData;

class StripInvoiceSettingCast implements CastsAttributes
{
Expand Down
13 changes: 12 additions & 1 deletion src/StripeDataServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@
use Ninjaparade\StripeData\Commands\SyncCustomersCommand;
use Ninjaparade\StripeData\Commands\SyncProductsCommand;
use Ninjaparade\StripeData\Data\Config\StripeConfig;
use Ninjaparade\StripeData\Models\StripeCustomer;
use Ninjaparade\StripeData\Models\StripeProduct;
use Ninjaparade\StripeData\Stripe\StripeService;
use Spatie\LaravelPackageTools\Package;
use Spatie\LaravelPackageTools\PackageServiceProvider;
use Illuminate\Database\Eloquent\Relations\Relation;

class StripeDataServiceProvider extends PackageServiceProvider
{
Expand All @@ -34,11 +37,19 @@ public function registeringPackage(): void
{
$this->app->singleton(
StripeService::class,
fn ($app) => new StripeService(
fn($app) => new StripeService(
config: StripeConfig::from(config('stripe-data.stripe'))
)
);

$this->app->alias(StripeService::class, 'stripe');
}

public function boot()
{
Relation::enforceMorphMap([
'stripe_customer' => StripeCustomer::class,
'stripe_product' => StripeProduct::class
]);
}
}

0 comments on commit 08bb991

Please sign in to comment.