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.12(1y ago)12.4k↓50%12MITPHPPHP ^7.4|^8.0

Since Oct 4Pushed 1y 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 1mo ago

READMEChangelog (10)Dependencies (5)Versions (16)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

35

—

LowBetter than 79% of packages

Maintenance40

Moderate activity, may be stable

Popularity23

Limited adoption so far

Community13

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

Recently: every ~187 days

Total

15

Last Release

508d 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)")

---

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

[lab404/laravel-impersonate

Laravel Impersonate is a plugin that allows to you to authenticate as your users.

2.3k16.4M48](/packages/lab404-laravel-impersonate)[santigarcor/laratrust

This package provides a flexible way to add Role-based Permissions to Laravel

2.3k5.4M43](/packages/santigarcor-laratrust)[codegreencreative/laravel-samlidp

Make your PHP Laravel application an Identification Provider using SAML 2.0. This package allows you to implement your own Identification Provider (idP) using the SAML 2.0 standard to be used with supporting SAML 2.0 Service Providers (SP).

263763.5k1](/packages/codegreencreative-laravel-samlidp)[webfox/laravel-xero-oauth2

A Laravel integration for Xero using the Oauth 2.0 spec

58452.0k2](/packages/webfox-laravel-xero-oauth2)

PHPackages © 2026

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