PHPackages                             spatie/laravel-harvest-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-harvest-sdk

ActiveLibrary[API Development](/categories/api)

spatie/laravel-harvest-sdk
==========================

A Laravel-friendly SDK to interact with the Harvest API

1.0.1(3mo ago)10MITPHPPHP ^8.3CI passing

Since Jan 12Pushed 1mo ago2 watchersCompare

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

READMEChangelog (2)Dependencies (30)Versions (5)Used By (0)

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

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

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

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

A Laravel-friendly SDK to interact with the Harvest API

Support us
----------

[](#support-us)

[![](https://camo.githubusercontent.com/b45d35c184685ff620afd91bd3435b12a414198b75a5c672f291cb508438aa87/68747470733a2f2f6769746875622d6164732e73332e65752d63656e7472616c2d312e616d617a6f6e6177732e636f6d2f6c61726176656c2d686172766573742d73646b2e6a70673f743d31)](https://spatie.be/github-ad-click/laravel-harvest-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-harvest-sdk
```

You can publish the config file with:

```
php artisan vendor:publish --tag="laravel-harvest-sdk-config"
```

Add your Harvest credentials to your .env file:

```
HARVEST_ACCOUNT_ID=your-account-id
HARVEST_ACCESS_TOKEN=your-access-token
HARVEST_USER_AGENT='name (name@email.com)'
```

Usage
-----

[](#usage)

To start interacting with the Harvest API, you can resolve the Harvest instance from the container or use the facade:

```
use Spatie\Harvest\Harvest;

$harvest = app(Harvest::class);

// or use the facade
use Spatie\Harvest\Facades\Harvest;
```

Users
-----

[](#users)

### Retrieve the authenticated user

[](#retrieve-the-authenticated-user)

```
use Spatie\Harvest\Data\UserData;
use Spatie\Harvest\Facades\Harvest;

$user = Harvest::users()->me()->dto();
// Returns: UserData
```

### Retrieve all users

[](#retrieve-all-users)

```
use Spatie\Harvest\Data\UserData;
use Spatie\Harvest\Facades\Harvest;

$users = Harvest::users()->all()->dto();
// Returns: array
```

Projects
--------

[](#projects)

### Retrieve all projects

[](#retrieve-all-projects)

```
use Spatie\Harvest\Data\ProjectData;
use Spatie\Harvest\Facades\Harvest;

$projects = Harvest::projects()->all()->dto();
// Returns: array
```

Time Entries
------------

[](#time-entries)

### Retrieve time entries

[](#retrieve-time-entries)

Time entries are paginated. You must provide a `from` date, and optionally a `to` date and `userId`.

```
use Spatie\Harvest\Data\TimeEntryData;
use Spatie\Harvest\Facades\Harvest;

$paginator = Harvest::timeEntries()->all(from: '2024-01-01', to: '2024-01-31');

foreach ($paginator as $timeEntries) {
    // Each page returns: array
}

// Or collect all pages
$allTimeEntries = $paginator->collect();
```

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

41

—

FairBetter than 87% of packages

Maintenance88

Actively maintained with recent releases

Popularity2

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

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

Total

2

Last Release

100d ago

### 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 (11 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (9 commits)")[![timvandijck](https://avatars.githubusercontent.com/u/4528796?v=4)](https://github.com/timvandijck "timvandijck (7 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (4 commits)")[![freekmurze](https://avatars.githubusercontent.com/u/483853?v=4)](https://github.com/freekmurze "freekmurze (3 commits)")[![AlexVanderbist](https://avatars.githubusercontent.com/u/6287961?v=4)](https://github.com/AlexVanderbist "AlexVanderbist (2 commits)")[![jimirobaer](https://avatars.githubusercontent.com/u/8984769?v=4)](https://github.com/jimirobaer "jimirobaer (1 commits)")

---

Tags

spatielaravellaravel-harvest-sdk

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

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

```
[![Health](https://phpackages.com/badges/spatie-laravel-harvest-sdk/health.svg)](https://phpackages.com/packages/spatie-laravel-harvest-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.2M101](/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.9k3](/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)
