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. spatie/laravel-float-sdk

ActiveLibrary

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

A Laravel SDK for the Float.com API

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

Since Feb 3Pushed 1mo 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 1mo ago

READMEChangelog (9)Dependencies (15)Versions (13)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://camo.githubusercontent.com/e5637d81263b86972a8450c0ca5e22b2a47bd42b870466a3f5fe4abfd34e8fa2/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f7370617469652f6c61726176656c2d666c6f61742d73646b2f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/spatie/laravel-float-sdk/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/85cc7b7cac30b92eb1852cc154b14da9ec6390be1c58351c9edf81a58797b30a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f7370617469652f6c61726176656c2d666c6f61742d73646b2f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](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

46

—

FairBetter than 93% of packages

Maintenance90

Actively maintained with recent releases

Popularity11

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 53.1% of commits — single point of failure

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 ~40 days

Recently: every ~62 days

Total

9

Last Release

142d 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] (10 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (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)")[![freekmurze](https://avatars.githubusercontent.com/u/483853?v=4)](https://github.com/freekmurze "freekmurze (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-data

Create unified resources and data transfer objects

1.7k28.9M626](/packages/spatie-laravel-data)[spatie/laravel-health

Monitor the health of a Laravel application

85810.0M83](/packages/spatie-laravel-health)[spatie/laravel-slack-alerts

Send a message to Slack

3212.6M4](/packages/spatie-laravel-slack-alerts)[spatie/laravel-login-link

Quickly login to your local environment

4381.2M1](/packages/spatie-laravel-login-link)[spatie/laravel-onboard

A Laravel package to help track user onboarding steps

808342.9k1](/packages/spatie-laravel-onboard)[spatie/laravel-model-flags

Add flags to Eloquent models

4301.1M1](/packages/spatie-laravel-model-flags)

PHPackages © 2026

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