PHPackages                             samsin33/laravel-razorpay - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Payment Processing](/categories/payments)
4. /
5. samsin33/laravel-razorpay

ActiveLibrary[Payment Processing](/categories/payments)

samsin33/laravel-razorpay
=========================

Laravel razorpay provides support for Laravel with Razorpay.

v3.0.1(4y ago)4361MITPHPPHP ^7.3|^8.0

Since Jan 22Pushed 4y ago1 watchersCompare

[ Source](https://github.com/samsin33/laravel-razorpay)[ Packagist](https://packagist.org/packages/samsin33/laravel-razorpay)[ RSS](/packages/samsin33-laravel-razorpay/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (9)Dependencies (20)Versions (13)Used By (0)

Introduction
------------

[](#introduction)

Razorpay package for laravel. Supports razorpay integration with laravel version 8.

Installation
------------

[](#installation)

Just install samsin33/laravel-razorpay package with composer.

```
$ composer require samsin33/laravel-razorpay
```

It uses razorpay/razorpay package and will be installed automatically.

Database Migration
------------------

[](#database-migration)

Razorpay service provider registers its own database migration directory, so remember to migrate your database after installing the package. The Razorpay migrations will add several columns to your customers and orders table as well as create new plans and subscriptions table to hold all of your customer's subscriptions:

```
$ php artisan migrate
```

If you need to overwrite the migrations that ship with this package, you can publish them using the vendor:publish Artisan command:

```
$ php artisan vendor:publish --tag="razorpay-migrations"
```

If you would like to prevent Razorpay's migrations from running entirely, you may use the ignoreMigrations method provided by Razorpay. Typically, this method should be called in the register method of your AppServiceProvider:

```
use Laravel\Razorpay\Razorpay;

/**
 * Register any application services.
 *
 * @return void
 */
public function register()
{
    Razorpay::ignoreMigrations();
}
```

Env Configuration
-----------------

[](#env-configuration)

Razorpay assumes your customer model will be the App\\Models\\User class that ships with Laravel. If you wish to change this you can specify a different model in your .env file:

```
RAZORPAY_MODEL=App\Models\User
```

Razorpay assumes your order model will be the App\\Models\\Order class that ships with Laravel. If you wish to change this you can specify a different model in your .env file:

```
RAZORPAY_ORDER_MODEL=App\Models\Order
```

Next, you should configure your Razorpay API keys in your application's .env file. You can retrieve your Razorpay API keys from the Razorpay control panel:

```
RAZORPAY_KEY=your-razorpay-key
RAZORPAY_SECRET=your-razorpay-secret
```

The default razorpay currency is Indian Rupee (INR). You can change the default currency by setting the RAZORPAY\_CURRENCY environment variable within your application's .env file:

```
RAZORPAY_CURRENCY=INR
```

Model Configuration
-------------------

[](#model-configuration)

Before using Razorpay, add the Billable trait to your customer model definition. Typically, this will be the App\\Models\\User model. This trait provides various methods to allow you to perform common tasks, such as fatching, creating and updating customer method information:

```
use Laravel\Razorpay\Billable;

class User extends Authenticatable
{
    use Billable;
}
```

Before using Razorpay, add the Orderable trait to your order model definition. Typically, this will be the App\\Models\\Order model. This trait provides various methods to allow you to perform common tasks, such as fatching, creating and updating order method information:

```
use Laravel\Razorpay\Orderable;

class Order extends Model
{
    use Orderable;
}
```

Customers
---------

[](#customers)

### Retrieving Customers

[](#retrieving-customers)

You can retrieve a customer by their Razorpay ID using the Razorpay::findBillable method. This method will return an instance of the billable model:

```
use Laravel\Razorpay\Razorpay;

$user = Razorpay::findBillable($razorpayId);
```

### Creating Customers

[](#creating-customers)

You can create a Razorpay customer by using the createRazorpayCustomer method in a billable model:

```
$razorpay_customer = $user->createRazorpayCustomer($options);
```

You may use the getRazorpayCustomer method if you want to return the Razorpay customer object for a billable model:

```
$razorpay_customer = $user->getRazorpayCustomer();
```

Orders
------

[](#orders)

### Creating Orders

[](#creating-orders)

You can create a Razorpay order by using the createRazorpayOrder method in a orderable model:

```
$razorpay_order = $user->createRazorpayOrder($options);
```

You may use the getRazorpayOrder method if you want to return the Razorpay orders for a orderable model:

```
$razorpay_customer = $user->getRazorpayOrder();
```

You may use the getRazorpayOrderPayments method if you want to return the Razorpay order payments for a orderable model:

```
$razorpay_customer = $user->getRazorpayOrderPayments();
```

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 90.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~22 days

Recently: every ~28 days

Total

12

Last Release

1689d ago

Major Versions

v1.0.0 → v2.0.02021-05-31

v2.0.x-dev → v3.0.02021-06-05

PHP version history (2 changes)v1.0.x-devPHP ^7.3

v3.0.1PHP ^7.3|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/e5808aade00ad88874f022815dcfcbad1d5d2071c82d3d2b5517267bc1ca0c29?d=identicon)[samsin33](/maintainers/samsin33)

---

Top Contributors

[![samarthas](https://avatars.githubusercontent.com/u/26267886?v=4)](https://github.com/samarthas "samarthas (28 commits)")[![samsin33](https://avatars.githubusercontent.com/u/18491431?v=4)](https://github.com/samsin33 "samsin33 (2 commits)")[![rambhosale](https://avatars.githubusercontent.com/u/21305685?v=4)](https://github.com/rambhosale "rambhosale (1 commits)")

---

Tags

laravelbillingrazorpay

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/samsin33-laravel-razorpay/health.svg)

```
[![Health](https://phpackages.com/badges/samsin33-laravel-razorpay/health.svg)](https://phpackages.com/packages/samsin33-laravel-razorpay)
```

###  Alternatives

[laravel/cashier

Laravel Cashier provides an expressive, fluent interface to Stripe's subscription billing services.

2.5k25.9M107](/packages/laravel-cashier)[laravel/cashier-paddle

Cashier Paddle provides an expressive, fluent interface to Paddle's subscription billing services.

264778.4k3](/packages/laravel-cashier-paddle)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k12.1M99](/packages/laravel-pulse)[psalm/plugin-laravel

Psalm plugin for Laravel

3274.9M308](/packages/psalm-plugin-laravel)[asciisd/knet

Knet package is provides an expressive, fluent interface to KNet's payment services.

141.1k](/packages/asciisd-knet)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
