dcodegroup/laravel-xero-employee
Composer 安装命令:
composer require dcodegroup/laravel-xero-employee
包简介
This package provides base functionality for linking a user with Xero
README 文档
README
This package provides the standard xero functionality for syncing Xero Employee ID with users and assigning pay rates to users.
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
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.
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. 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.
dcodegroup/laravel-xero-employee 适用场景与选型建议
dcodegroup/laravel-xero-employee 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2.63k 次下载、GitHub Stars 达 1, 最近一次更新时间为 2021 年 09 月 30 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「laravel」 「employee」 「xero」 「dcode」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 dcodegroup/laravel-xero-employee 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 dcodegroup/laravel-xero-employee 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 dcodegroup/laravel-xero-employee 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Laravel wrapper for Xero
An extension for using the Xero API from within Yii2
Symfony bundle wrapping the XeroPHP library
Send invoices to Xero including contacts, payments and even inventory updates.
List and details for authors and employees
Alfabank REST API integration
统计信息
- 总下载量: 2.63k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 17
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-09-30