toneflix / laravel-op
Laravel OP is a simple API agnostic fork of Laravel that provides a set of tools to help you build your Laravel application faster and easier. It is a collection of useful classes, traits, and functions that I have found useful in my own projects. It is a work in progress and I will be adding more f
Requires
- php: ^8.3
- laravel-notification-channels/twilio: ^4.2
- laravel/framework: ^13.0
- laravel/sanctum: ^4.3
- laravel/tinker: ^3.0
- maatwebsite/excel: ^4.0
- matomo/device-detector: ^6.4
- predis/predis: ^2.3
- spatie/laravel-permission: ^6.16
- stripe/stripe-php: ^22.0
- toneflix/kudisms-notification: ^2.0
- toneflix/laravel-dbconfig: ^2.0
- toneflix/laravel-fileable: ^3.0
- toneflix/laravel-pay-pocket: ^4.0
- toneflix/laravel-resource-modifier: ^2.0
- toneflix/paystack-php: ^1.0
- valorin/random: ^1.0
Requires (Dev)
- fakerphp/faker: ^1.23
- laravel/pint: ^1.27
- laravel/sail: ^1.69
- mockery/mockery: ^1.6
- nunomaduro/collision: ^8.9
- phpunit/phpunit: ^12.0
- spatie/laravel-ignition: ^2.12
- toneflix/faker-pictwo: ^2.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
- dev-main
- 11.x-dev
- 9.x-dev
- 4.0.2
- 4.0.1
- 4.0.0
- 3.0.12
- 3.0.11
- 3.0.10
- 3.0.9
- 3.0.8
- 3.0.7
- 3.0.6
- 3.0.5
- 3.0.4
- 3.0.3
- 3.0.2
- 3.0.1
- 3.0.0
- 2.1.0
- 2.0.9
- 2.0.8
- 2.0.7
- 2.0.6
- 2.0.5
- 2.0.4
- 2.0.3
- 2.0.2
- 2.0.1
- 2.0.0
- 1.0.5
- 1.0.4
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0.0
- dev-chore/add-agent-docs-and-dash-cleanup
- dev-feat/wire-up-wallet-payments
- dev-docs/document-whats-included
- dev-docs/drop-toneflix-code-prefix-readme
- dev-feat/laravel-13-upgrade
This package is auto-updated.
Last update: 2026-10-24 10:34:52 UTC
README
Laravel OP is a simple API agnostic fork of Laravel that provides a set of tools to help you build your Laravel application faster and easier. It is a collection of useful classes, traits, and functions that I have found useful in my own projects. It is a work in progress and I will be adding more features as I need them. I hope you find it useful too.
Usage
To use this package you have to initialize it as a project using composer:
composer create-project toneflix/laravel-op
What's Included
Laravel OP bundles a set of third-party packages and in-house subsystems chosen to cover the things almost every API backend ends up needing. Packages with their own documentation are linked out to rather than re-documented here.
Payments
Three interchangeable payment processors behind a single PaymentInterface (intent() / verify() / deauthorize() / transfer()), selected per-request via payWith($processor) on App\Traits\ControllerCanExtend:
| Processor | Backed by | Notes |
|---|---|---|
paystack |
toneflix/paystack-php |
This kit's own Paystack SDK, replacing the abandoned yabacon/paystack-php. |
stripe |
stripe/stripe-php (official SDK) |
Replaces the abandoned cartalyst/stripe-laravel. |
wallet |
toneflix/laravel-pay-pocket |
Internal balance-based payments, no external gateway. Deducts synchronously from the user's wallet(s); see Preparation in that package's README for wallet types (App\Enums\WalletEnums) and priority order. |
Every attempt is recorded in the Transaction model (App\Models\Transaction), including a polymorphic transactable link back to whatever the payment was for.
Notifications
- Email & SMS verification: 6-digit OTP codes (via
valorin/random, notrand()), rate-limited, with a time-limited window (token_lifespansetting, in seconds). Also supports a base64url "code|hash" link variant for clickable email links. - SMS delivery is pluggable between
laravel-notification-channels/twilioandtoneflix/kudisms-notification(a Nigeria-market gateway), switchable at runtime via theprefered_sms_channelsetting, no redeploy needed. - DB-editable templates: every system email/SMS has a hardcoded default in
config/messages.php, but an admin can override the copy per-key from the database via the admin API, without touching code.
Settings
toneflix/laravel-dbconfig is the backbone of runtime configuration: most settings a deployer would expect in .env (currency, token lifespans, reference prefixes, preferred SMS channel, feature toggles) are instead rows in the database, editable live through the admin configurations endpoint. .env is only the fallback for a handful of secrets.
File uploads
toneflix/laravel-fileable powers avatar uploads and named upload "collections" (banners, logos, private files/images/videos), responsive image variants, and secure/dynamic file-serving routes. Configured per-collection in config/toneflix-fileable.php.
API responses & resources
toneflix/laravel-resource-modifier standardizes the shape of every JSON Resource response (pagination meta/links keys, optional camelCase) and ships a make:resource command this kit re-exposes under its own namespace. Every controller returns through a small set of response macros (response()->success()/error()/info(), see App\Helpers\Provider) for a consistent {status, status_code, message, data} envelope.
Admin & permissions
spatie/laravel-permission backs the whole authorization layer. Roles and permissions are declared in config/permission-defs.php; one Laravel Gate is registered per permission (App\Helpers\Access), with an enable_admin_permission_middleware setting to turn the whole thing off for local dev. php artisan app:sync-roles seeds roles/permissions onto users.
Exports
Any model registered in config/exports.php can be exported to .xlsx via maatwebsite/excel, synchronously, or queued with an email notification linking to a time-limited signed download (php artisan app:export, or the generic SimpleDataExporter service).
Sessions & devices
API auth is token-based via laravel/sanctum, with each token named by the device's user-agent string. matomo/device-detector turns that into a human-readable label for the "my devices" list (GET /account/devices), so a user can see and revoke sessions by device.
Dev tooling
toneflix/faker-pictwois bound as the app's globalFaker\Generator, so any seeder/factory callingfake()->imageUrl()gets real-looking placeholder images out of the box.laravel/pint,laravel/sail, and the standard PHPUnit/Mockery/Collision stack for formatting, local Docker, and testing.