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

ActiveLibrary

dcodegroup/laravel-xero-leave
=============================

This package provides the standard Xero functionality for submitting leave applications to Xero

0.1.8(1y ago)22.2k↓50%1MITPHPPHP ^7.4||^8.0

Since Oct 26Pushed 1y ago2 watchersCompare

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

READMEChangelog (9)Dependencies (4)Versions (10)Used By (0)

Laravel Xero Leave
==================

[](#laravel-xero-leave)

This package provides the standard xero functionality for sending leave applications to Xero.

This package provides

- Tables for leave
- depends on dcodegroup/laravel-xero-employee
- events for approval
- config for approval or not
- Configuration for the types of leave
- commands to keep settings updated.
- button to re-sync

How it works
------------

[](#how-it-works)

Follow the installation instructions. Select set if you want to approval requests The events that are fired

Events
------

[](#events)

- Leave application created
- Leave Approval Required
- Leave Approved - has a listener fire send to xero
-

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

[](#installation)

You can install the package via composer:

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

Then run the install command.

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

This will publish the configuration file and the migrations.

Then run the migrations

```
php artsian migrate
```

The following table will be added to your project

```
leaves
---
id bigint(20) PK IDENTITY
leavable_type varchar(255)
leaveable_id unsignedbigint
xero_leave_application_id 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
xero_leave_type_id varchar(50) # The identifier returned from xero stored in the configuration
start_date date
end_date date
units double(8,2) # in case the duration is less than a day
title varchar(50)
description varchar(200) NULL
xero_periods json NULL
xero_exception_message text NULL
approved_at timestamp NULL
declined_at timestamp NULL
decline_reason text NULL
xero_synced_at timestamp NULL
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-leave.php` and adjust as needed

Usage
-----

[](#usage)

You should implement your own frontend to this package. However the model and the events etc are already fired for you. Below will guide you through what you need to do.

Create your own `Leave::class` model class that extends the packages model.

```
