Laravel Packages

FakerPHP Stripe Provider

Published
FakerPHP Stripe Provider image

Faker Stripe is a provider for FakerPHP that generates fake but structurally correct IDs for Stripe API resources. Stripe has quite a few different resource types, but this package has well over 50+ different faker methods:

$faker->stripeCorePaymentIntentId();
// pi_KiAjc3WFzvswIhq8IkCLXNBW
 
$faker->stripeConnectAccountId();
// acct_xBXg7yyrSyQVbsjM
 
$faker->stripeFinancialConnectionAccountId();
// fca_z3JzQ1OCkYved5uWOqh3b387

This package easily integrates with PestPHP, PHPUnit, and Eloquent: Factories:

// Pest example
beforeEach(function () {
$this->fake = fake();
$this->fake->addProvider(new Stripe($this->fake));
});
 
it('shows an example', function () {
$this->fake->stripeConnectAccountId() // acct_xBXg7yyrSyQVbsjM
});
 
 
// Laravel factory example
use WithFaker;
 
public function definition(): array
{
$this->faker->addProvider(new Stripe($this->faker));
 
$this->faker->stripeConnectAccountId(); // acct_xBXg7yyrSyQVbsjM
}

You can learn more about this package, get full installation instructions, and view the source code on GitHub.

Paul Redmond photo

Staff writer at Laravel News. Full stack web developer and author.

Sponsored

acquaintsoft logo
Acquaint Softtech

Hire Laravel developers with AI expertise at $20/hr. Get started in 48 hours.

Visit Acquaint Softtech

The latest

View all →
CPX: The Composer Package Executor for PHP image

CPX: The Composer Package Executor for PHP

Read article
Laravel AI SDK Adds Human-in-the-Loop Tool Approval image

Laravel AI SDK Adds Human-in-the-Loop Tool Approval

Read article
Pest 5 Released With Test Impact Analysis, Agent Verification, and Evals image

Pest 5 Released With Test Impact Analysis, Agent Verification, and Evals

Read article
Queue-SQL: Run Mass Deletes and Updates Across Parallel Queue Jobs image

Queue-SQL: Run Mass Deletes and Updates Across Parallel Queue Jobs

Read article
Blade Formatting in Laravel Pint image

Blade Formatting in Laravel Pint

Read article
Inertia DevTools Is Now on the Chrome Web Store image

Inertia DevTools Is Now on the Chrome Web Store

Read article