PHPackages                             philharmonie/timr-laravel - 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. philharmonie/timr-laravel

ActiveLibrary[API Development](/categories/api)

philharmonie/timr-laravel
=========================

Timr API integration for Laravel

v1.1.0(1y ago)015MITPHPPHP ^8.2

Since Jan 10Pushed 1y ago1 watchersCompare

[ Source](https://github.com/philharmonie/timr-laravel)[ Packagist](https://packagist.org/packages/philharmonie/timr-laravel)[ Fund](https://www.paypal.com/paypalme/pharmonie)[ GitHub Sponsors](https://github.com/philharmonie)[ RSS](/packages/philharmonie-timr-laravel/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (12)Versions (4)Used By (0)

Timr API Laravel Package
========================

[](#timr-api-laravel-package)

[![Latest Version on Packagist](https://camo.githubusercontent.com/5adb5fda721a8c0b7ed9a9b722ad7bdfb7ec019ec9e6bef31fcec13da6a22e0a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7068696c6861726d6f6e69652f6c61726176656c2d74696d722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/philharmonie/laravel-timr)
[![Total Downloads](https://camo.githubusercontent.com/7a0017074326e8aaed59fc24a1e08d415bf8bcbcd2cbe8b75972fae7cfed838e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7068696c6861726d6f6e69652f6c61726176656c2d74696d722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/philharmonie/laravel-timr)
[![License](https://camo.githubusercontent.com/8a9ac601acade6f4dd95a1672b1348ef2fabc665c78f2fa006992963dc49d198/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f7068696c6861726d6f6e69652f6c61726176656c2d74696d722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/philharmonie/laravel-timr)

About
-----

[](#about)

This package provides a foundation for integrating with the Timr API. Currently, the `Project-Times` endpoint is implemented, including listing and updating project times. Contributions to extend the functionality are highly encouraged and welcome!

Requirements
------------

[](#requirements)

- PHP ^8.2
- Laravel ^10.0
- Guzzle ^7.0 or ^8.0

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

[](#installation)

You can install the package via composer:

```
composer require philharmonie/laravel-timr

```

### Service Provider

[](#service-provider)

The service provider is automatically registered using Laravel's auto-discovery feature. If you need to register it manually, add the following line to the `providers` array in `config/app.php`:

```
PhilHarmonie\LaravelTimr\ServiceProvider::class,

```

Configuration
-------------

[](#configuration)

Publish the configuration file:

```
php artisan vendor:publish --tag="timr-config"

```

Add your Timr API credentials to your `.env` file:

```
TIMR_BASE_URL=https://api.timr.com/v0.2/
TIMR_CLIENT_ID=your-client-id
TIMR_CLIENT_SECRET=your-client-secret
TIMR_TOKEN_URL=https://api.timr.com/v0.2/token

```

Usage
-----

[](#usage)

### Project Times

[](#project-times)

#### Using the Facade

[](#using-the-facade)

```
use PhilHarmonie\Timr\Timr;

// List project times
$projectTimes = Timr::projectTimes();

// List project times with filters
$projectTimes = Timr::projectTimes([
    'start_from' => '2025-01-01',
    'users' => ['user-id-1', 'user-id-2'],
    'billable' => true
]);

// Access the collection
foreach ($projectTimes->getItems() as $projectTime) {
    echo $projectTime->id;
    echo $projectTime->start->format('Y-m-d H:i:s');
    echo $projectTime->billable ? 'Billable' : 'Not billable';
}

// Update a project time
$response = Timr::updateProjectTime('project-time-id', [
    'start' => '2025-01-01T08:00:00Z',
    'end' => '2025-01-01T12:00:00Z',
    'notes' => 'Updated notes',
]);
```

#### Using the Service Directly

[](#using-the-service-directly)

If you prefer dependency injection:

```
use PhilHarmonie\Timr\Service\TimrService;

class YourController
{
    public function __construct(
        private readonly TimrService $timrService
    ) {}

    public function index()
    {
        $projectTimes = $this->timrService->projectTimes([
            'start_from' => '2025-01-01'
        ]);
    }

    public function update(string $id)
    {
        $updatedProjectTime = $this->timrService->updateProjectTime($id, [
            'notes' => 'Updated project notes'
        ]);
    }
}
```

#### Direct Client Usage

[](#direct-client-usage)

If you need more control, you can use the client directly:

```
use PhilHarmonie\Timr\Contracts\TimrClientInterface;

$client = app(TimrClientInterface::class);

// GET request
$response = $client->get('project-times', ['start_from' => '2025-01-01']);
```

Extending the Package
---------------------

[](#extending-the-package)

The package is designed to be easily extensible. To add support for additional Timr API endpoints:

1. Create a new repository interface and implementation:

```
namespace YourApp\Repositories;

use PhilHarmonie\Timr\Contracts\TimrClientInterface;

class YourRepository implements YourRepositoryInterface
{
    public function __construct(
        private readonly TimrClientInterface $client
    ) {}
}
```

2. Add your repository to the service provider:

```
$this->app->singleton(YourRepositoryInterface::class, YourRepository::class);
```

3. Extend the `TimrService` with your new methods:

```
class TimrService
{
    public function yourNewMethod(): mixed
    {
        return $this->yourRepository->someMethod();
    }
}
```

Testing
-------

[](#testing)

Run the following command to test the package:

```
composer test

```

This will run:

- Code style checks (Pint)
- Static analysis (PHPStan)
- Unit tests (Pest)
- Refactoring checks (Rector)

You can also run individual test commands:

```
composer test:lint    # Run Laravel Pint
composer test:types   # Run PHPStan
composer test:unit    # Run Pest tests
composer test:refacto # Run Rector

```

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

[](#contributing)

Please see `CONTRIBUTING.md` for details.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Phil Harmonie](https://github.com/philharmonie)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see `LICENSE.md` for more information.

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance42

Moderate activity, may be stable

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~6 days

Total

3

Last Release

474d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/49812f3fd6f17e6c988107697eac9df6d436ab9d751ab0e8c31cba6dd9cc4f7b?d=identicon)[philharmonie](/maintainers/philharmonie)

---

Top Contributors

[![philharmonie](https://avatars.githubusercontent.com/u/5270589?v=4)](https://github.com/philharmonie "philharmonie (4 commits)")

---

Tags

apilaravelpackagetimertimr

###  Code Quality

TestsPest

Static AnalysisPHPStan, Rector

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/philharmonie-timr-laravel/health.svg)

```
[![Health](https://phpackages.com/badges/philharmonie-timr-laravel/health.svg)](https://phpackages.com/packages/philharmonie-timr-laravel)
```

###  Alternatives

[essa/api-tool-kit

set of tools to build an api with laravel

52680.5k](/packages/essa-api-tool-kit)[smodav/mpesa

M-Pesa API implementation

16363.7k1](/packages/smodav-mpesa)[bmatovu/laravel-mtn-momo

Laravel MTN MOMO integration.

14310.9k](/packages/bmatovu-laravel-mtn-momo)[joggapp/laravel-aws-sns

Laravel package for the SNS events by AWS

3171.8k](/packages/joggapp-laravel-aws-sns)[vinelab/api-manager

Laravel API Manager Package - beatify and unify your responses with the least effort possible.

392.1k](/packages/vinelab-api-manager)

PHPackages © 2026

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