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(1mo ago)10[2 PRs](https://github.com/spatie/laravel-harvest-sdk/pulls)MITPHPPHP ^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 1mo ago

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://camo.githubusercontent.com/1b1b0229f6532009c41e01b4f3c9a4a75bc29377a0b06b763dc3ad39f10e855b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f7370617469652f6c61726176656c2d686172766573742d73646b2f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/spatie/laravel-harvest-sdk/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/443386d577f05e35740166528632ae8f64d3256672032643fd449335975bd3f8/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f7370617469652f6c61726176656c2d686172766573742d73646b2f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](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 89% of packages

Maintenance91

Actively maintained with recent releases

Popularity2

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity52

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

48d 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] (7 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] (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)")[![freekmurze](https://avatars.githubusercontent.com/u/483853?v=4)](https://github.com/freekmurze "freekmurze (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-route-discovery

Auto register routes using PHP attributes

23645.0k2](/packages/spatie-laravel-route-discovery)[scalar/laravel

Render your OpenAPI-based API reference

6183.9k2](/packages/scalar-laravel)[ryangjchandler/bearer

Minimalistic token-based authentication for Laravel API endpoints.

8129.8k](/packages/ryangjchandler-bearer)[codebar-ag/laravel-docuware

DocuWare integration with Laravel

1221.1k](/packages/codebar-ag-laravel-docuware)[combindma/laravel-facebook-pixel

Meta pixel integration for Laravel

4956.9k](/packages/combindma-laravel-facebook-pixel)[stechstudio/laravel-hubspot

A Laravel SDK for the HubSpot CRM Api

2971.0k](/packages/stechstudio-laravel-hubspot)

PHPackages © 2026

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