spatie/laravel-float-sdk
Laravel-friendly SDK for interacting with the Float.com API (v3). Configure your API token and user agent via .env/config and use the provided FloatClient to access Float endpoints. Not a full API implementation; contributions welcome.
Pros:
FloatClient), aligning with Laravel’s ecosystem (e.g., Eloquent, Queues). Reduces boilerplate for API clients.users(), projects(), etc.) mirror Float’s API structure, enabling logical separation of concerns in the codebase.Params classes (e.g., GetUsersParams) for type safety and IDE autocompletion, improving developer experience.page, perPage, and sort parameters simplifies handling large datasets (critical for expense reports).expand and fields parameters allow lazy-loading related data (e.g., client for projects), optimizing performance.Cons:
expenses, reports, webhooks). Requires direct API calls or PRs for unsupported features.FloatClient in the container, reducing setup complexity..env setup (FLOAT_API_TOKEN, FLOAT_USER_AGENT) with published config.User, Project) for consistency. May require mapping to Eloquent models for persistence.expand for nested data (e.g., client in projects), but deep nesting (e.g., client.contacts) may need custom handling.| Risk Area | Severity | Mitigation |
|---|---|---|
| Partial API Coverage | High | Plan for direct API calls or contribute missing endpoints via PRs. |
| Single-Object Parsing | Medium | Test edge cases (e.g., empty responses) post-1.0.1. Use try-catch for API calls. |
| Rate Limiting | Medium | Implement Saloon’s retry logic or Laravel Queues for bulk operations. |
| Data Model Mismatch | Low | Use Laravel’s model casting or custom accessors to adapt Float’s schema. |
| Dependency Updates | Low | Monitor Saloon and Laravel for breaking changes. |
| Webhook Gaps | High | Build a separate service for webhook handling (e.g., Lumen microservice). |
expenses, reports) critical for your MVP? If yes, will you extend the SDK or use direct API calls?Expenses table)? Will you use Eloquent models or raw arrays?FloatClient, API mocking)?FloatClient is auto-bound, enabling dependency injection in controllers/services.ExpenseSubmitted) for notifications or syncs.Http::fake()) to mock Float API responses.Expense, Project) using accessors or observers.json column.composer require spatie/laravel-float-sdk) and configure .env.users(), projects(), and allocations endpoints with sample data.withRetry()).Expense, Client).ExpenseApproved event → Slack notification).page/perPage parameters.publicHolidays) with Laravel Cache.| Component | Compatibility | Notes |
|---|---|---|
| Laravel | 8.0+ (tested) | Avoid Laravel 9+ if using PHP < 8.1. |
| PHP | 8.0+ | Saloon requires PHP 8.0+. |
| Float API v3 | Yes | Aligns with official docs. |
| Databases | MySQL, PostgreSQL, SQLite | No DB-specific dependencies. |
| Queues | Redis, Database, Sync | Use Queues for async operations to avoid rate limits. |
| Testing | Pest, PHPUnit | Mock API responses with Http::fake(). |
users, projects, and allocations to local models.php artisan vendor:publish --tag="float-sdk-config").User, Project, Allocation.How can I help you explore Laravel packages today?