This package provides a seamless integration with the Float.com API for Laravel applications.
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.
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'),
];
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;
}
}
use Spatie\FloatSdk\Facades\Float;
$users = Float::users()->all();
foreach ($users as $user) {
echo $user->name;
}
composer test
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.