PHPackages                             dcodegroup/laravel-xero-employee - 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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. dcodegroup/laravel-xero-employee

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

dcodegroup/laravel-xero-employee
================================

This package provides base functionality for linking a user with Xero

0.1.13(3w ago)12.6k↑105.9%12MITPHPPHP ^7.4|^8.0CI passing

Since Oct 4Pushed 3w ago2 watchersCompare

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

READMEChangelog (10)Dependencies (10)Versions (17)Used By (2)

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

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

This package provides the standard xero functionality for syncing Xero Employee ID with users and assigning pay rates to users.

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

[](#installation)

You can install the package via composer:

```
composer require dcodegroup/laravel-xero-employee
```

Then run the install command.

```
php artsian laravel-xero-employee:install
```

This will publish the configuration and migrations file

Run the migrations

```
php artsian migrate
```

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

[](#configuration)

After running install the following fields will be added to the users table.

- xero\_employee\_id
- xero\_default\_earnings\_rate\_id
- xero\_time\_and\_a\_half\_earnings\_rate\_id
- xero\_double\_time\_earnings\_rate\_id

You will need to add these fields to your fillable array within the `User::class` model

```
    /**
     * The attributes that are mass assignable.
     *
     * @var string[]
     */
    protected $fillable = [
                   'xero_employee_id',
                   'xero_default_payroll_calendar_id',
                   'xero_default_earnings_rate_id',
                   'xero_time_and_a_half_earnings_rate_id',
                   'xero_double_time_earnings_rate_id',
                   ...
    ];
```

You also need to add the following interface to the `User::class` model.

```
use Dcodegroup\LaravelXeroEmployee\Contracts\XeroEmployeeUserMappings;

class User extends Authenticatable implements XeroEmployeeUserMappings
{
    ...
```

You should then implement the methods defined in the contract. eg Like below but what ever your using

```
  public function getXeroEmployeeNameAttribute(): string
  {
    //return $this->name;
    //return $this->first_name . ' ' . $this->last_name;
    return $this->prefered_name;
  }
```

The assumption is you have already synced the payroll details from the [dcodegroup/laravel-xero-payroll-au](https://github.com/dcodegroup/laravel-xero-payroll-au).

There is a second command you can use to automatically populate the fields added for earnings rate to default to those you have already configured within [dcodegroup/laravel-xero-payroll-au](https://github.com/dcodegroup/laravel-xero-payroll-au). You can run this multiple times as you get new users as it will only update users that have no values.

You should add the following trait to the Users model.

```
class User extends Authenticatable
{
    use UsesXeroEmployee;
```

This package provides a route that can be used to provide an endpoint to dispatch the SyncXeroEmployee job.

\[example.com/xero-employee/{user}\] xero\_employee.sync Please see the config file if you wish to customise the route. This will dispatch the job for the user and sync them to your application.

###  Health Score

49

—

FairBetter than 94% of packages

Maintenance94

Actively maintained with recent releases

Popularity21

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 92.5% 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 ~114 days

Recently: every ~321 days

Total

16

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 (37 commits)")[![yohannca](https://avatars.githubusercontent.com/u/7054076?v=4)](https://github.com/yohannca "yohannca (3 commits)")

---

Tags

laravelemployeexerodcode

###  Code Quality

Code StyleLaravel Pint

### Embed Badge

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

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

###  Alternatives

[jeremy379/laravel-openid-connect

OpenID Connect support to the PHP League's OAuth2 Server. Compatible with Laravel Passport.

59437.0k9](/packages/jeremy379-laravel-openid-connect)[api-platform/laravel

API Platform support for Laravel

58171.8k14](/packages/api-platform-laravel)[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)
