PHPackages                             dcodegroup/laravel-xero-timesheet-sync - 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. dcodegroup/laravel-xero-timesheet-sync

ActiveLibrary[API Development](/categories/api)

dcodegroup/laravel-xero-timesheet-sync
======================================

This package provides the standard xero functionality for syncing timesheets from your app to Xero.

0.1.13(3w ago)22.6k↑218.8%2MITPHPPHP ^8.0CI passing

Since Oct 13Pushed 3w ago2 watchersCompare

[ Source](https://github.com/DCODE-GROUP/laravel-xero-timesheet-sync)[ Packagist](https://packagist.org/packages/dcodegroup/laravel-xero-timesheet-sync)[ RSS](/packages/dcodegroup-laravel-xero-timesheet-sync/feed)WikiDiscussions master Synced yesterday

READMEChangelog (10)Dependencies (12)Versions (16)Used By (0)

Laravel Xero Timesheet Sync
===========================

[](#laravel-xero-timesheet-sync)

This package provides the standard xero functionality for syncing timesheets from your app to Xero.

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

[](#installation)

You can install the package via composer:

```
composer require dcodegroup/laravel-xero-timesheet-sync
```

Then run the install command.

```
php artsian laravel-xero-timesheet-sync:install
```

This will publish the configuration file and the migrations.

Then run the migrations

```
php artsian migrate
```

This will add the following fields to timesheets table and create two new tables.

```
timesheets
---
can_include_in_xero_sync tinyint(1) DEFAULT=0
units double(8,2)
xero_timesheet_id unsignedbigint(255) FK >- xero_timesheets.id

xero_timesheets
---
id bigint(20) PK IDENTITY
xerotimeable_type varchar(255)
xerotimeable_id unsignedbigint
xero_timesheet_guid varchar(50) NULL # The identifier returned from xero
xero_employee_id varchar(50) NULL # may be redundant becuase its on the user that should be the polymporphic field. But saves a lookup
status varchar(50) NULL DEFAULT=DRAFT
start_date date
stop_date date
hours double(8,2)
synced_at timestamp NULL
deleted_at timestamp NULL
created_at timestamp NULL
updated_at timestamp NULL

xero_timesheets_lines
---
id bigint(20) PK IDENTITY
xero_timesheet_id unsignedbigint(255) FK >- xero_timesheets.id
xero-earnings_rate_id
date date
units double(8,2)
units_override double(8,2)
deleted_at timestamp NULL
created_at timestamp NULL
updated_at timestamp NULL
```

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

[](#configuration)

Most of configuration has been set the fair defaults. However you can review the configuration file at `config/laravel-xero-timesheet-sync.php` and adjust as needed

You will need to add this field to your fillable array within the Timesheet model. Will not need this if you are extending the base timesheet model as that has guarded \[\].

```
    /**
     * The attributes that are mass assignable.
     *
     * @var string[]
     */
    protected $fillable = [
                   'can_include_in_xero_sync',
                   'units',
                   'xero_timesheet_id'
                   ...
    ];
```

It is suggested that you also cast the `can_include_in_xero_sync` as a boolean field in the `Timesheet` model.

```
    /**
     * The attributes that should be cast.
     *
     * @var array
     */
    //protected $casts = [
    //               'can_include_in_xero_sync' => 'boolean',
    //               ...
    //];

    /**
      *  Merge casts with the existing
     */
    public function getCasts(): array
    {
        return parent::getCasts() + [
            'can_include_in_xero_sync' => 'boolean',
        ];
    }
```

You should add the interface to the `Timesheet::class` model.

```
use Dcodegroup\LaravelXeroTimesheetSync\Contracts\SyncsTimesheetsToXero;

class Timesheet extends BaseTimesheet implements SyncsTimesheetsToXero
{
```

You should add the following trait to the Timesheet model.

```
class Timesheet extends Authenticatable
{
    use XeroTimesheetable;
```

you need to implement these methods

In order for the timesheet row to be used / factored into sending to Xero the `timesheets.can_include_in_xero_sync` needs to be flagged / set as true or value 1. This needs to be implemented at the local app level.

Three helper methods are provided in the `XeroTimesheetable.php` trait.

```
    public function includeInXeroSync()
    {
        $this->update(['can_include_in_xero_sync', true]);
    }

    public function excludeFromXeroSync()
    {
        $this->update(['can_include_in_xero_sync', false]);
    }

    public function toggleIncludeInXeroSync()
    {
        $this->can_include_in_xero_sync = !$this->can_include_in_xero_sync;
        $this->save();
    }
```

Routes
------

[](#routes)

The following routes are exposed by the package

```
+--------+----------+-----------------------------+-----------------------------+-------------------------------------------------------------------------------------+----------------------------------+
| Domain | Method   | URI                         | Name                        | Action                                                                              | Middleware                       |
+--------+----------+-----------------------------+-----------------------------+-------------------------------------------------------------------------------------+----------------------------------+
|        | GET|HEAD | xero-timesheet-sync/preview | xero_timesheet_sync.preview | Dcodegroup\LaravelXeroTimesheetSync\Http\Controllers\XeroTimesheetPreviewController | web                              |
|        |          |                             |                             |                                                                                     | App\Http\Middleware\Authenticate |
|        | GET|HEAD | xero-timesheet-sync/summary | xero_timesheet_sync.summary | Dcodegroup\LaravelXeroTimesheetSync\Http\Controllers\XeroTimesheetSummaryController | web                              |
|        |          |                             |                             |                                                                                     | App\Http\Middleware\Authenticate |
+--------+----------+-----------------------------+-----------------------------+-------------------------------------------------------------------------------------+----------------------------------+

```

The package exposes some routes that allow you preview timesheets for a user

You can also view a summary of the timesheets for a period

Jobs
----

[](#jobs)

Commands
--------

[](#commands)

There is a command you can run to update the Xero configurations from `dcodegroup/laravel-xero-payroll-au` via Laravels scheduler

```
php artsian laravel-xero-timesheet-sync:update-xero-configuration-data
```

You should add it to your `app/Console/Kernel.php` file to run it once a day. You could run it more often if wanted with the --force flag

```
    /**
     * Define the application's command schedule.
     *
     * @param Schedule $schedule
     * @return void
     */
    protected function schedule(Schedule $schedule)
    {
        $schedule->command('laravel-xero-timesheet-sync:update-xero-configuration-data')->daily();
        ...
    }
```

###  Health Score

49

—

FairBetter than 94% of packages

Maintenance94

Actively maintained with recent releases

Popularity23

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 95.8% 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 ~130 days

Recently: every ~321 days

Total

14

Last Release

27d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b0e8e7e3202508183e3ba9f9a95abcffdab114ce86e33e52a67abd58194d3d86?d=identicon)[dcodegroup](/maintainers/dcodegroup)

---

Top Contributors

[![lionslair](https://avatars.githubusercontent.com/u/832259?v=4)](https://github.com/lionslair "lionslair (136 commits)")[![robert-dcode](https://avatars.githubusercontent.com/u/93114650?v=4)](https://github.com/robert-dcode "robert-dcode (2 commits)")[![yohannca](https://avatars.githubusercontent.com/u/7054076?v=4)](https://github.com/yohannca "yohannca (2 commits)")[![pyr0hu](https://avatars.githubusercontent.com/u/4921742?v=4)](https://github.com/pyr0hu "pyr0hu (1 commits)")[![TungDcode](https://avatars.githubusercontent.com/u/75203313?v=4)](https://github.com/TungDcode "TungDcode (1 commits)")

---

Tags

laravelsyncxerodcodetimesheets

###  Code Quality

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/dcodegroup-laravel-xero-timesheet-sync/health.svg)

```
[![Health](https://phpackages.com/badges/dcodegroup-laravel-xero-timesheet-sync/health.svg)](https://phpackages.com/packages/dcodegroup-laravel-xero-timesheet-sync)
```

###  Alternatives

[statamic/cms

The Statamic CMS Core Package

4.8k3.6M992](/packages/statamic-cms)[darkaonline/l5-swagger

OpenApi or Swagger integration to Laravel

3.0k37.6M133](/packages/darkaonline-l5-swagger)[knuckleswtf/scribe

Generate API documentation for humans from your Laravel codebase.✍

2.3k14.2M62](/packages/knuckleswtf-scribe)[api-platform/laravel

API Platform support for Laravel

58171.6k14](/packages/api-platform-laravel)[scriptdevelop/whatsapp-manager

Paquete para manejo de WhatsApp Business API en Laravel

783.8k](/packages/scriptdevelop-whatsapp-manager)[ecotone/laravel

Ecotone for Laravel — CQRS, Event Sourcing, Sagas, Durable Workflows, and Outbox on top of Laravel Queue, via PHP attributes.

21318.6k3](/packages/ecotone-laravel)

PHPackages © 2026

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