PHP code example of dcodegroup / laravel-xero-employee

1. Go to this page and download the library: Download dcodegroup/laravel-xero-employee library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

dcodegroup / laravel-xero-employee example snippets


    /**
     * 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',
                   ...
    ];

 

use Dcodegroup\LaravelXeroEmployee\Contracts\XeroEmployeeUserMappings;

class User extends Authenticatable implements XeroEmployeeUserMappings
{
    ...



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


class User extends Authenticatable
{
    use UsesXeroEmployee;

bash
php artsian laravel-xero-employee:install
bash
php artsian migrate