naif/paypal
A Laravel package for integrating PayPal payments into your application. It offers a simple way to configure PayPal credentials and interact with PayPal’s API, helping you add payment flows with less boilerplate and minimal setup. Designed for developers seeking a straightforward PayPal integration.
This is a Laravel Nova card, not a general-purpose PayPal SDK. It only makes sense if you already run Nova and want a dashboard widget showing the PayPal account balance plus recent transactions. With 12 stars and a last release in January 2019, treat it as a starting point you may need to patch rather than a maintained dependency.
Minimal steps:
8 era). Check composer.json constraints in the repo against your laravel/nova, laravel/framework, and PHP versions before committing. On Nova 4+/Laravel 10+ expect to either fork or pin older versions.
2. Install:
composer require naif/paypal
If Composer refuses due to version constraints, install with --with-all-dependencies or fork the repo and relax the constraints — do not force it blindly into a production lockfile.
3. Publish config/assets:
php artisan vendor:publish --provider="Naif\Paypal\PaypalServiceProvider"
Confirm the actual provider/namespace from the package's composer.json autoload block; the repo is nova-paypal but the package name is naif/paypal, so the namespace may be Naif\Paypal or Naif\NovaPaypal.
4. Add PayPal API credentials (client ID + secret) to the published config. Use PayPal's REST app credentials, and start with sandbox credentials, not live.
5. Register the card in app/Providers/NovaServiceProvider.php:
protected function cards()
{
return [
// ...your other cards
new \Naif\Paypal\Paypal(),
];
}
(Older Nova used Nova::cards([...]) in boot() — use whichever your Nova version supports.)
6. Look here first when it misbehaves: the published config file (endpoint/mode/credentials), the card class (src/*.php) to see which PayPal endpoint it calls, and the compiled Vue component if the widget renders but shows no data.
First use case: a finance/ops dashboard where someone wants an at-a-glance PayPal balance and the last N transactions without logging into PayPal. That is the entire scope — do not plan to build checkout, refunds, or webhooks on top of this card.
APP_ENV. The safest pattern is to read credentials from env vars (PAYPAL_CLIENT_ID, PAYPAL_SECRET, PAYPAL_MODE=sandbox|live) and reference them in the config file rather than hardcoding into the published config, which is easy to commit by accident.canSee() / authorizedToSee() on the card (or gate registration) so only finance/admin users load it. The balance is sensitive.Cache::remember(...)) either by subclassing the card and overriding its data-fetch method, or by adding a thin proxy route/controller that the card calls. This is the single biggest day-to-day improvement over the stock package.component() / withMeta() / data methods to change the refresh interval, transaction count, or display currency. Keeps you upgradable (or at least forkable).composer.json constraints on laravel/nova / laravel/framework commonly block installs on modern stacks. Forking and bumping constraints is normal here — but re-test the card's actual API calls, because "installs" ≠ "works.".env, add the config to .gitignore if you customize it, and never commit live PayPal secrets.storage/logs/laravel.log, opening browser devtools → Network and inspecting the card's XHR, and hitting the PayPal endpoint manually with curl using the same credentials to isolate whether it's the card or PayPal.composer.lock, and if you rely on it, fork it into your own VCS so upstream disappearance or a broken PayPal change doesn't block deploys.withMeta, component, data-fetch method), the published config, and the Vue component under resources/js. Those three cover ~90% of customization needs (refresh cadence, credentials, display).How can I help you explore Laravel packages today?