Skip to content

fs98/clockodo-client

Repository files navigation

Clockodo Client Laravel Package

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

The Clockodo Laravel Package is a convenient and easy-to-use integration that allows Laravel developers to seamlessly integrate Clockodo time tracking functionality into their Laravel applications. Clockodo is a popular time tracking and management tool that helps businesses track and manage their working hours efficiently.

This package provides a set of Laravel-specific features and utilities that simplify the process of integrating Clockodo into your Laravel application. It encapsulates the complexities of making API requests, handling responses, and provides a streamlined approach for interacting with Clockodo within Laravel.

Features:

  • Seamless integration with Laravel applications.
  • Simplified API communication with Clockodo.
  • Laravel service provider for easy registration and configuration.
  • Wrapper classes and methods for common Clockodo operations.
  • Convenient configuration options for customizing behavior.
  • Comprehensive test suite for reliable functionality.

Support Us

We invest a lot of resources into creating best in class open source packages. You can support us by buying one of our paid products.

We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on our contact page. We publish all received postcards on our virtual postcard wall.

Installation

You can install the package via composer:

composer require fs98/clockodo-client

You can publish and run the migrations with:

php artisan vendor:publish --tag="clockodo-client-migrations"
php artisan migrate

You can publish the config file with:

php artisan vendor:publish --tag="clockodo-client-config"

This is the contents of the published config file:

return [

    /*
   * Mandatory headers for clockodo request authentication
   */
    'headers' => [
        'X-Clockodo-External-Application' => env('CLOCKODO_EXTERNAL_APPLICATION'),
        'X-ClockodoApiUser' => env('CLOCKODO_API_USER'),
        'X-ClockodoApiKey' => env('CLOCKODO_API_KEY'),
    ],

    /**
     * Official URL of the Clockodo API
     */
    'api_url' => env('CLOCKODO_API_URL', 'https://my.clockodo.com/api'),

    /*
    * List of clockodo absence <typ></typ>es
    */
    'absence_types' => [
        1 => 'Regular holiday',
        2 => 'Special leaves',
        3 => 'Reduction of overtime',
        4 => 'Sick day',
        5 => 'Sick day of a child',
        6 => 'School / further education',
        7 => 'Maternity protection',
        8 => 'Home office (planned hours are applied)',
        9 => 'Work out of office (planned hours are applied)',
        10 => 'Special leaves (unpaid)',
        11 => 'Sick day (unpaid)',
        12 => 'Sick day of a child (unpaid)',
        13 => 'Quarantine (only full days)',
        14 => 'Military / alternative service (only full days)',
        15 => 'Sick day (sickness benefit)',
    ],

    /*
    * List of clockodo absence statuses
    */
    'absence_statuses' => [
        0 => 'enquired/reported',
        1 => 'approved',
        2 => 'declined',
        3 => 'approval cancelled',
        4 => 'request cancelled',
    ],
];

Optionally, you can publish the views using

php artisan vendor:publish --tag="clockodo-client-views"

Usage

$clockodo = new Fs98\ClockodoClient\Clockodo();
return $clockodo->absences->get(2023);

Testing

composer test

To run specific group of tests (eg. unit), do

composer test -- --group unit

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

About

Convenient and easy-to-use Clockodo integration package for Laravel.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Contributors 3

  •  
  •  
  •  

Languages