voffice-indonesia/core-sdk
最新稳定版本:v0.1.9
Composer 安装命令:
composer require voffice-indonesia/core-sdk
包简介
SDK for using single of truth authentication service(vAuth) in other internal vOffice app with seamless integration.
README 文档
README
A powerful, plug-and-play Laravel package for seamless OAuth integration with Laravel Passport servers. Built with Clean Architecture principles for enterprise-grade applications.
✨ Key Features
- 🚀 Plug & Play: Zero configuration, works out of the box
- 🔐 Enterprise Security: OAuth2 + PKCE with automatic token refresh
- 🏗️ Clean Architecture: SOLID principles, testable, maintainable
- 🎨 Modern UI: Livewire 3.0 components with Tailwind CSS
- ⚡ Laravel Integration: Custom guards, Filament compatible, middleware
- 🧪 Fully Tested: 33+ tests with comprehensive coverage
🚀 Quick Start
1. Install
composer require voffice-indonesia/core-sdk
2. Setup
php artisan core:setup
3. Configure Environment
VAUTH_URL=https://your-oauth-server.com VAUTH_CLIENT_ID=your-client-id VAUTH_CLIENT_SECRET=your-client-secret VAUTH_REDIRECT_URI=https://your-app.com/auth/oauth/callback
4. Protect Routes
Route::middleware(['vauth'])->group(function () { Route::get('/dashboard', [DashboardController::class, 'index']); });
5. Use VAuth Service
use VoxDev\Core\Facades\VAuth; // Get users from OAuth server $users = VAuth::getUsers(); // Get locations $locations = VAuth::getLocations(); // Check authentication $isAuthenticated = VAuth::hasValidToken();
🎉 That's it! Your app now has OAuth authentication!
📚 Documentation
Getting Started
- 📦 Installation Guide - Step-by-step setup
- ⚙️ Configuration - Complete configuration reference
- 🚀 Basic Usage - Essential features and patterns
Usage Guides
- 🛡️ Middleware - Route protection and authentication
- 📡 VAuth Service - API integration and data fetching
- 🎨 Livewire Components - Reactive UI components
- 🔧 Filament Integration - Admin panel integration
Architecture & Advanced
- 🏗️ Clean Architecture - Architecture principles
- 📁 Package Structure - Code organization
- 🔌 Extending the Package - Customization guide
Examples & Reference
- 💻 Code Examples - Real-world implementations
- 📋 API Reference - Complete API documentation
- 🚨 Troubleshooting - Common issues and solutions
🎯 Use Cases
This package is perfect for:
- Internal company applications that need centralized authentication
- Microservices architecture with shared authentication service
- Multi-tenant applications with OAuth-based user management
- Enterprise applications requiring clean, maintainable code
- Rapid prototyping with plug-and-play OAuth integration
🛠️ Requirements
- PHP: 8.2+
- Laravel: 10.x, 11.x, 12.x
- Laravel Passport OAuth Server: Running and accessible
🔧 Advanced Features
Clean Architecture
Built with clean architecture principles:
- Domain-driven design
- Dependency inversion
- SOLID principles
- Fully testable
Auto-Configuration
Intelligent defaults that just work:
- Auth guards auto-registered
- Middleware auto-configured
- Routes auto-loaded
- Livewire components auto-registered
Enterprise Security
Production-ready security features:
- OAuth2 with PKCE
- Automatic token refresh
- Secure cookie handling
- Session optimization
🧪 Testing
composer test
The package includes comprehensive tests:
- 33+ test cases
- Feature and unit tests
- Architecture tests
- Clean code validation
🔄 Changelog
Please see CHANGELOG for recent changes.
🤝 Contributing
Please see CONTRIBUTING for details.
🔒 Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
📄 License
The MIT License (MIT). Please see License File for more information.
🙏 Credits
Made with ❤️ by VOffice Indonesia
统计信息
- 总下载量: 68
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-06-11