PHPackages                             spatie/laravel-float-sdk - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. spatie/laravel-float-sdk

ActiveLibrary[API Development](/categories/api)

spatie/laravel-float-sdk
========================

A Laravel SDK for the Float.com API

1.0.1(1mo ago)422[1 PRs](https://github.com/spatie/laravel-float-sdk/pulls)MITPHPPHP ^8.3CI passing

Since Feb 3Pushed 1w ago2 watchersCompare

[ Source](https://github.com/spatie/laravel-float-sdk)[ Packagist](https://packagist.org/packages/spatie/laravel-float-sdk)[ Docs](https://github.com/spatie/laravel-float-sdk)[ GitHub Sponsors](https://github.com/Spatie)[ RSS](/packages/spatie-laravel-float-sdk/feed)WikiDiscussions main Synced today

READMEChangelog (10)Dependencies (30)Versions (15)Used By (0)

A Laravel SDK for the Float.com API
===================================

[](#a-laravel-sdk-for-the-floatcom-api)

[![Latest Version on Packagist](https://camo.githubusercontent.com/932707384e66ca76a72e6aeece27e9ddd832e515b8446d15b90358160c856d04/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7370617469652f6c61726176656c2d666c6f61742d73646b2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/spatie/laravel-float-sdk)[![GitHub Tests Action Status](https://github.com/spatie/laravel-float-sdk/actions/workflows/run-tests.yml/badge.svg)](https://github.com/spatie/laravel-float-sdk/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://github.com/spatie/laravel-float-sdk/actions/workflows/fix-php-code-style-issues.yml/badge.svg)](https://github.com/spatie/laravel-float-sdk/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/984a585e1f93edcf0b16c988c9bdc99f36a779cab65a9fb86697e2a355e0b6ee/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7370617469652f6c61726176656c2d666c6f61742d73646b2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/spatie/laravel-float-sdk)

A Laravel-friendly SDK to interact with the [Float API (v3)](https://developer.float.com/).

**Note:** this is not a full implementation for the Float API, but we welcome PR's if you need anything that is still missing.

[![](https://camo.githubusercontent.com/aae35d943d2f69a7bb57c51e827b752169bf21dd78a39b4392bb31475c4bff08/68747470733a2f2f6769746875622d6164732e73332e65752d63656e7472616c2d312e616d617a6f6e6177732e636f6d2f6c61726176656c2d666c6f61742d73646b2e6a70673f743d31)](https://spatie.be/github-ad-click/laravel-float-sdk)

We invest a lot of resources into creating [best in class open source packages](https://spatie.be/open-source). You can support us by [buying one of our paid products](https://spatie.be/open-source/support-us).

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](https://spatie.be/about-us). We publish all received postcards on [our virtual postcard wall](https://spatie.be/open-source/postcards).

Installation
------------

[](#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
-----

[](#usage)

### Instantiating the Client

[](#instantiating-the-client)

You can use the `FloatClient` class to interact with the Float API. Why is it called `FloatClient` and not just `Float`, you ask? Well, float is a reserved keyword in PHP.

The `FloatClient` is bound to the Laravel service container and can be injected:

```
use Spatie\FloatSdk\FloatClient;

public function __construct(protected FloatClient $float) {}

public function index()
{
    $users = $this->float->users()->all();
}
```

### Available endpoints

[](#available-endpoints)

The `FloatClient` exposes the following resource groups:

- users()
- projects()
- projectTasks()
- clients()
- allocations()
- timeOff()
- publicHolidays()

Each group has methods to fetch individual records or lists with optional filters.

### Users

[](#users)

#### Get user by ID

[](#get-user-by-id)

```
$user = $float->users()->get(1);
```

#### Get all users

[](#get-all-users)

```
// Without filters
$users = $float->users()->all();

// With filters
use Spatie\FloatSdk\QueryParameters\GetUsersParams;

$users = $float->users()->all(
    new GetUsersParams(
        active: true,
        departmentId: 5,
    )
);
```

### Projects

[](#projects)

#### Get project by ID

[](#get-project-by-id)

```
$project = $float->projects()->get(10);
```

#### Get all projects

[](#get-all-projects)

```
// Without filters
$projects = $float->projects()->all();

// With filters
use Spatie\FloatSdk\QueryParameters\GetProjectsParams;

$projects = $float->projects()->all(
    new GetProjectsParams(
        clientId: 10,
        tagName: 'Design',
        fields: ['id', 'name'],
        expand: ['client'],
    )
);
```

### Project tasks

[](#project-tasks)

#### Get project task by ID

[](#get-project-task-by-id)

```
$task = $float->projectTasks()->get(1);
```

#### Get all project tasks

[](#get-all-project-tasks)

```
// Without filters
$tasks = $float->projectTasks()->all();

// With filters
use Spatie\FloatSdk\QueryParameters\GetProjectTasksParams;

$tasks = $float->projectTasks()->all(
    new GetProjectTasksParams(
        projectId: 42,
        billable: true,
        fields: ['id', 'name'],
    )
);
```

### Clients

[](#clients)

#### Get client by ID

[](#get-client-by-id)

```
$client = $float->clients()->get(1);
```

#### Get all clients

[](#get-all-clients)

```
// Without filters
$clients = $float->clients()->all();

// With filters
use Spatie\FloatSdk\QueryParameters\GetClientsParams;

$clients = $float->clients()->all(
    new GetClientsParams(
        fields: ['id', 'name'],
        expand: ['projects'],
    )
);
```

### Allocations

[](#allocations)

#### Get allocation by ID

[](#get-allocation-by-id)

```
$allocation = $float->allocations()->get(1);
```

#### Get all allocations

[](#get-all-allocations)

```
// Without filters
$allocations = $float->allocations()->all();

// With filters
use Spatie\FloatSdk\QueryParameters\GetAllocationsParams;

$allocations = $float->allocations()->all(
    new GetAllocationsParams(
        projectId: 10,
        startDate: '2025-01-01',
        endDate: '2025-12-31',
    )
);
```

### Time Off

[](#time-off)

#### Get all time off entries

[](#get-all-time-off-entries)

```
// Fetch time off entries within a date range
$timeOffs = $float->timeOff()->all('2025-01-01', '2025-12-31');
```

#### Get time off types

[](#get-time-off-types)

```
$timeOffTypes = $float->timeOff()->types();
```

### Public Holidays

[](#public-holidays)

#### Get all public holidays

[](#get-all-public-holidays)

```
// Fetch public holidays for a specific year
$holidays = $float->publicHolidays()->all(2025);
```

### Pagination &amp; Sorting

[](#pagination--sorting)

You can pass a parameter object to the `all()` methods. All parameters are optional.

- `page` (int): Page number (default: 1)
- `perPage` (int): Number of items per page (default: 50)
- `sort` (string): Sort field (e.g., "name", "modified\_since")

```
use Spatie\FloatSdk\QueryParameters\GetUsersParams;

new GetUsersParams(
    page: 2,
    perPage: 25,
    sort: 'name'
);
```

### Selecting fields

[](#selecting-fields)

Limit which fields are returned by passing the `fields` array:

```
use Spatie\FloatSdk\QueryParameters\GetProjectsParams;

new GetProjectsParams(
    fields: ['id', 'name', 'client_id']
);
```

### Expanding relationships

[](#expanding-relationships)

Some endpoints support expanding related data using the `expand` array:

```
use Spatie\FloatSdk\QueryParameters\GetProjectsParams;

new GetProjectsParams(
    expand: ['client']
);
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Niels Vanpachtenbeke](https://github.com/Nielsvanpach)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

47

—

FairBetter than 93% of packages

Maintenance94

Actively maintained with recent releases

Popularity11

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~51 days

Recently: every ~98 days

Total

10

Last Release

54d ago

Major Versions

0.0.8 → 1.0.02025-12-18

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/7535935?v=4)[Spatie](/maintainers/spatie)[@spatie](https://github.com/spatie)

---

Top Contributors

[![Nielsvanpach](https://avatars.githubusercontent.com/u/10651054?v=4)](https://github.com/Nielsvanpach "Nielsvanpach (51 commits)")[![timvandijck](https://avatars.githubusercontent.com/u/4528796?v=4)](https://github.com/timvandijck "timvandijck (26 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (12 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (5 commits)")[![freekmurze](https://avatars.githubusercontent.com/u/483853?v=4)](https://github.com/freekmurze "freekmurze (4 commits)")[![AlexVanderbist](https://avatars.githubusercontent.com/u/6287961?v=4)](https://github.com/AlexVanderbist "AlexVanderbist (2 commits)")[![riasvdv](https://avatars.githubusercontent.com/u/3626559?v=4)](https://github.com/riasvdv "riasvdv (2 commits)")[![jimirobaer](https://avatars.githubusercontent.com/u/8984769?v=4)](https://github.com/jimirobaer "jimirobaer (1 commits)")

---

Tags

spatielaravellaravel-float-sdk

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/spatie-laravel-float-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/spatie-laravel-float-sdk/health.svg)](https://phpackages.com/packages/spatie-laravel-float-sdk)
```

###  Alternatives

[spatie/laravel-permission

Permission handling for Laravel 12 and up

12.9k102.4M1.4k](/packages/spatie-laravel-permission)[dedoc/scramble

Automatic generation of API documentation for Laravel applications.

2.1k11.2M100](/packages/dedoc-scramble)[spatie/laravel-pdf

Create PDFs in Laravel apps

1.0k4.8M47](/packages/spatie-laravel-pdf)[defstudio/telegraph

A laravel facade to interact with Telegram Bots

816333.8k3](/packages/defstudio-telegraph)[spatie/laravel-passkeys

Use passkeys in your Laravel app

471890.7k39](/packages/spatie-laravel-passkeys)[codebar-ag/laravel-docuware

DocuWare integration with Laravel

1123.7k](/packages/codebar-ag-laravel-docuware)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
