litepie / integrations
A Laravel package for managing API integrations similar to Facebook/Google applications
Requires
- php: ^8.2
- illuminate/contracts: ^12.0
- illuminate/database: ^12.0
- illuminate/http: ^12.0
- illuminate/support: ^12.0
- illuminate/validation: ^12.0
Requires (Dev)
- mockery/mockery: ^1.6
- orchestra/testbench: ^10.0
- phpunit/phpunit: ^11.0
This package is auto-updated.
Last update: 2025-08-31 15:27:31 UTC
README
A production-ready Laravel package for managing API integrations and OAuth applications. This package provides a complete integration management system with multi-tenant support.
Requirements
- PHP 8.2 or higher
- Laravel 12.x
- MySQL 8.0+ / PostgreSQL 13+ / SQLite 3.35+
Features
- Create and manage API integrations (OAuth clients)
- Auto-generated Client ID and Client Secret
- Multiple redirect URIs support
- Status management (active/inactive)
- Multi-tenant ready
- Laravel Passport/Sanctum authentication support
- Comprehensive API endpoints
- Policy-based authorization
- PSR-4 compliant
- Full test coverage
Installation
Install the package via Composer:
composer require litepie/integration
Publish the configuration and migrations:
php artisan vendor:publish --provider="Litepie\Integration\IntegrationServiceProvider"
Run the migrations:
php artisan migrate
Configuration
The package publishes a configuration file to config/integration.php
where you can customize:
- Database table names
- Middleware settings
- Authentication guards
- Default settings
Usage
Creating an Integration
use Litepie\Integration\Models\Integration; $integration = Integration::create([ 'name' => 'My API Integration', 'description' => 'Integration for my application', 'redirect_uris' => ['https://myapp.com/callback'], 'status' => 'active', 'user_id' => auth()->id(), ]);
API Endpoints
The package provides RESTful API endpoints:
GET /api/integrations
- List integrationsPOST /api/integrations
- Create integrationGET /api/integrations/{id}
- Show integrationPUT /api/integrations/{id}
- Update integrationDELETE /api/integrations/{id}
- Delete integration
Multi-tenant Support
The package automatically handles multi-tenancy by associating integrations with the authenticated user.
Testing
Run the test suite:
vendor/bin/phpunit
License
The MIT License (MIT). Please see License File for more information.