spatie / laravel-float-sdk
A Laravel SDK for the Float.com API
Fund package maintenance!
Spatie
Requires
- php: ^8.3
- illuminate/contracts: ^11.0
- saloonphp/laravel-plugin: ^3.0
- spatie/laravel-package-tools: ^1.16
Requires (Dev)
- larastan/larastan: ^2.9
- laravel/pint: ^1.14
- nunomaduro/collision: ^8.1.1||^7.10.0
- orchestra/testbench: ^9.0.0||^8.22.0
- pestphp/pest: ^3.0
- pestphp/pest-plugin-arch: ^3.0
- pestphp/pest-plugin-laravel: ^3.0
- phpstan/extension-installer: ^1.3
- phpstan/phpstan-deprecation-rules: ^1.1
- phpstan/phpstan-phpunit: ^1.3
- spatie/laravel-ray: ^1.35
README
This package provides a seamless integration with the Float.com API for Laravel applications.
Support us
We invest a lot of resources into creating best in class open source packages. You can support us by buying one of our paid products.
We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on our contact page. We publish all received postcards on our virtual postcard wall.
Installation
You can install the package via composer:
composer require spatie/laravel-float-sdk
Add the following environment variables to your .env file:
FLOAT_API_TOKEN=your_api_token_here FLOAT_USER_AGENT=YourAppName (your-email@example.com)
You can publish the config file with:
php artisan vendor:publish --tag="float-sdk-config"
This is the contents of the published config file:
return [ 'api_token' => env('FLOAT_API_TOKEN'), 'user_agent' => env('FLOAT_USER_AGENT'), ];
Usage
Making API Requests
You can use the FloatClient
to interact with the Float API. Here's an example of fetching all users:
use Spatie\FloatSdk\FloatClient; use Spatie\FloatSdk\Requests\GetUsers; public function execute(FloatClient $client) { $users = $client->users()->all(); foreach ($users as $user) { echo $user->name; } }
Using the Facade
use Spatie\FloatSdk\Facades\Float; $users = Float::users()->all(); foreach ($users as $user) { echo $user->name; }
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.