Skip to content
Stripe integration for Laravel 4
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Stripe for Laravel 4

Integrates the Stripe PHP library with Laravel 4 via a ServiceProvider, config, and Blade extensions.


Include laravel-stripe as a dependency in composer.json:

"abodeo/laravel-stripe": "dev-master"

Run composer install to download the dependency.

Add the ServiceProvider to your provider array within app/config/app.php:

'providers' => array(



Finally, publish the configuration files via php artisan config:publish abodeo/laravel-stripe.


It is advisable to keep all of your sensitive configuration out of your configuration files. Instead, utilize Laravel's "dot files" to keep them out of source control and making them easily overridable on dev environments.

If you have not setup a "dot file", read Laravel's "Protecting Sensitive Configuration for detailed setup instructions. To quickly get up an running, simply create a .env.php file in the same directory as you apps composer.json file. Then add your Stripe API credentials to it.

return array(
  'stripe' => array(
    'api_key' => 'my-api-key',
    'publishable_key' => 'my-pub-key'

If you insist on keeping your API credentials in your config, you can set your API Key and Publishable Key in app/config/packages/abodeo/laravel-stripe/stripe.php:

return array(
  'api_key' => 'my-api-key',
  'publishable_key' => 'my-pub-key'


You may use the Stripe PHP Library as normal within your application. The Stripe API will automatically be configured with your API Key, so you do not need to set it yourself.

In your Blade views, you may output your Stripe Publishable Key using the @stripeKey Blade extension:

<script src="" class="stripe-button"
          data-amount="5000" data-description="One year's subscription"></script>
You can’t perform that action at this time.