PHPackages                             brightcweb/paypal - 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. brightcweb/paypal

ActiveLibrary[Payment Processing](/categories/payments)

brightcweb/paypal
=================

A professional PayPal integration package for Laravel applications, suitable for any Laravel application, such as NGO'S, e-commerces and more

v1.0.0(1y ago)04MITPHPPHP ^8.0

Since Jan 26Pushed 1y ago1 watchersCompare

[ Source](https://github.com/Bright11/brightcweblaravelpaypalpackage)[ Packagist](https://packagist.org/packages/brightcweb/paypal)[ RSS](/packages/brightcweb-paypal/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (2)Used By (0)

BrightCWeb PayPal Integration Package
=====================================

[](#brightcweb-paypal-integration-package)

**Brightcweb/Paypal** is a Laravel package that simplifies PayPal integration for your e-commerce system or donation platform. With this package, you can handle payments efficiently while maintaining the flexibility to customize routes, views, and authentication requirements.

---

Features
--------

[](#features)

- Seamless PayPal checkout integration.
- Customizable success and cancellation routes.
- Records all payment transactions in the `Brightcwebpayment` table.
- Optionally enforce user authentication before checkout.
- Pre-built, modifiable views for success and cancellation pages.

---

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

[](#installation)

### Install the package via Composer:

[](#install-the-package-via-composer)

```
composer require brightcweb/paypal
```

### Publish the package configuration assets:

[](#publish-the-package-configuration-assets)

```
php artisan vendor:publish --tag=brightpaypalconfig
```

### Run the migrations to create the `Brightcwebpayment` table:

[](#run-the-migrations-to-create-the-brightcwebpayment-table)

```
php artisan migrate
```

### Add the following entries to your `.env` file:

[](#add-the-following-entries-to-your-env-file)

```
PAYPAL_CLIENT_ID=your-paypal-client-id
PAYPAL_CLIENT_SECRET=your-paypal-client-secret
```

### Clear and cache the configuration:

[](#clear-and-cache-the-configuration)

```
php artisan config:clear
php artisan cache:clear
php artisan config:cache
```

---

Usage
-----

[](#usage)

### Controller Setup

[](#controller-setup)

- In your controller, import the PayPal class and inject it into the constructor:

```
use Brightcweb\Paypal\Myclass\BrightCWebPaypalClass;

class YourController extends Controller
{
    protected $BrightCwebPaypalClass;

    public function __construct(BrightCWebPaypalClass $BrightCWebPaypalClass)
    {
        $this->BrightCwebPaypalClass = $BrightCWebPaypalClass;
    }
}
```

### Checkout Endpoint

[](#checkout-endpoint)

Create a route and controller method for initiating the checkout process. Example:

```
public function checkout(Request $req)
{
    $amount = $req->amount; // Get order or donation amount
    $paymentData = $this->BrightCwebPaypalClass->createPaypalOrder($amount);

    return redirect($paymentData['links'][1]['href']);
}
```

Define the route in `web.php`:

```
Route::get('/checkout', [YourController::class, 'checkout'])->name('checkout');
```

### Success and Cancel Routes

[](#success-and-cancel-routes)

Add routes for handling successful and canceled payments:

```
public function successpaypal(Request $request)
{
    $orderId = $request->query('token');
    $payerId = $request->query('PayerID');

    $paymentDetails = $this->BrightCwebPaypalClass->handlePaymentSuccess($orderId, $payerId);

    if ($paymentDetails) {
        // Optionally send notifications or update tables
        return view('vendor.brightcwebpaypal.sucesspaypal', $paymentDetails);
    }

    return view('vendor.brightcwebpaypal.canceled');
}

public function cancelpaypal()
{
    return view('vendor.brightcwebpaypal.canceled');
}
```

Define these routes in `web.php`:

```
Route::get('/successpaypal', [YourController::class, 'successpaypal'])->name('successpaypal');
Route::get('/cancelpaypal', [YourController::class, 'cancelpaypal'])->name('cancelpaypal');
```

### Add these routes in your `.env` file:

[](#add-these-routes-in-your-env-file)

```
PAYPAL_SUCCESS_ROUTE="success payment route name"
PAYPAL_CANCELLED_ROUTE="cancelled payment route name"
```

---

Views Customization
-------------------

[](#views-customization)

The package includes default views for success and cancellation located in `vendor/brightcwebpaypal`. Feel free to modify or rename them according to your needs.

### Authentication

[](#authentication)

This package allows you to decide whether users should be authenticated before proceeding with checkout or not. You can customize your middleware as needed.

---

Key Features
------------

[](#key-features)

### Payment Recording

[](#payment-recording)

Every successful payment is recorded in the `Brightcwebpayment` table for easy tracking.

### Optional Authentication

[](#optional-authentication)

You have full control over whether users need to be authenticated before initiating a checkout or not. This package works perfectly without authentication, which is useful in scenarios where registration is not required for checkout.

---

Clearing and Caching Configuration
----------------------------------

[](#clearing-and-caching-configuration)

Whenever you make changes to your `.env` file or configuration, remember to run the following commands:

```
php artisan config:clear
php artisan cache:clear
php artisan config:cache
```

---

Notes
-----

[](#notes)

- Ensure that your PayPal credentials in the `.env` file are correct.
- Ensure that `PAYPAL_SUCCESS_ROUTE` and `PAYPAL_CANCELLED_ROUTE` are correctly set in your `.env` file.
- Always test your integration in PayPal's sandbox environment before going live.
- Use `php artisan optimize:clear` if you encounter any cache-related issues.

---

Support
-------

[](#support)

For support, please send us an email at:

---

License
-------

[](#license)

This package is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).

---

Contributing
------------

[](#contributing)

We welcome contributions to enhance this package. Please contact us at  for any inquiries or contributions.

---

Conclusion
----------

[](#conclusion)

The Brightcweb PayPal Package is an excellent tool for integrating a payment gateway into your Laravel application, suitable for any project requiring PayPal payment integration.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance42

Moderate activity, may be stable

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

477d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/867217b5dc6bb67627e1d9b0c4d4a639a67e617cc93c553a2ecd034522b9139a?d=identicon)[Chika](/maintainers/Chika)

---

Top Contributors

[![Bright11](https://avatars.githubusercontent.com/u/34070274?v=4)](https://github.com/Bright11 "Bright11 (4 commits)")

---

Tags

laravellaravel 11payment processingpaypalpayment gatewayphp-8laravel paypallaravel payment gatewaybrightcwebpaypal integrationBright C Web Developerlaravel paypal integration packagelaravel 11 paypal integrationbrightcweb laravel paypal integrationbrightcweb laravel paypal integration packagebrightcweb laravel payment gatewaybrightcweb laravel 11 paypal integrationbrightcweb laravel 11 paypal integration packagebrightcweb laravel 11 payment gateway

### Embed Badge

![Health badge](/badges/brightcweb-paypal/health.svg)

```
[![Health](https://phpackages.com/badges/brightcweb-paypal/health.svg)](https://phpackages.com/packages/brightcweb-paypal)
```

###  Alternatives

[shetabit/payment

Laravel Payment Gateway Integration Package

944330.1k5](/packages/shetabit-payment)[luigel/laravel-paymongo

A laravel wrapper for Paymongo API

7956.2k1](/packages/luigel-laravel-paymongo)[musahmusah/laravel-multipayment-gateways

A Laravel Package that makes implementation of multiple payment Gateways endpoints and webhooks seamless

852.2k1](/packages/musahmusah-laravel-multipayment-gateways)[logicalgrape/paypal-ipn-laravel

A PayPal IPN client for Laravel.

3416.2k](/packages/logicalgrape-paypal-ipn-laravel)[itsmurumba/laravel-mpesa

Laravel Package for Mpesa Daraja API

191.6k](/packages/itsmurumba-laravel-mpesa)

PHPackages © 2026

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