{"id":18940994,"url":"https://github.com/cleaniquecoders/attendance","last_synced_at":"2025-04-15T19:31:56.673Z","repository":{"id":56953529,"uuid":"151268826","full_name":"cleaniquecoders/attendance","owner":"cleaniquecoders","description":"An Adaptive Attendance for Laravel - enabled developers to integrate with existing attendance system and devices such as Access Card, Biometric, etc","archived":true,"fork":false,"pushed_at":"2018-10-03T13:43:49.000Z","size":45,"stargazers_count":34,"open_issues_count":2,"forks_count":20,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-30T15:47:47.642Z","etag":null,"topics":["access-card","api","attendance","biometric","ble","laravel","mobile"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cleaniquecoders.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-10-02T14:31:01.000Z","updated_at":"2024-11-26T02:41:51.000Z","dependencies_parsed_at":"2022-08-21T08:50:09.792Z","dependency_job_id":null,"html_url":"https://github.com/cleaniquecoders/attendance","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cleaniquecoders%2Fattendance","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cleaniquecoders%2Fattendance/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cleaniquecoders%2Fattendance/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cleaniquecoders%2Fattendance/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cleaniquecoders","download_url":"https://codeload.github.com/cleaniquecoders/attendance/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249138858,"owners_count":21218960,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["access-card","api","attendance","biometric","ble","laravel","mobile"],"created_at":"2024-11-08T12:25:12.140Z","updated_at":"2025-04-15T19:31:56.379Z","avatar_url":"https://github.com/cleaniquecoders.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n[![Build Status](https://travis-ci.org/cleaniquecoders/attendance.svg?branch=master)](https://travis-ci.org/cleaniquecoders/attendance) [![Latest Stable Version](https://poser.pugx.org/cleaniquecoders/attendance/v/stable)](https://packagist.org/packages/cleaniquecoders/attendance) [![Total Downloads](https://poser.pugx.org/cleaniquecoders/attendance/downloads)](https://packagist.org/packages/cleaniquecoders/attendance) [![License](https://poser.pugx.org/cleaniquecoders/attendance/license)](https://packagist.org/packages/cleaniquecoders/attendance)\n\n## About Your Package\n\nThis is an Adaptive Attendance package - enabled developers to integrate with existing attendance system and devices such as Access Card, Biometric, etc.\n\nThis package comes with common attendance adapaters:\n\n1. Web Adapter - use for Web based attendance system\n2. API Adapter - use for Mobile based attendance system\n3. Console Adapter - use for Queue based attendance system\n\nSee usage section below for custom adapters.\n\n## Installation\n\n1. In order to install `cleaniquecoders/attendance` in your Laravel project, just run the *composer require* command from your terminal:\n\n```\n$ composer require cleaniquecoders/attendance\n```\n\n2. Then in your `config/app.php` add the following to the providers array:\n\n```php\nCleaniqueCoders\\Attendance\\AttendanceServiceProvider::class,\n```\n\n3. In the same `config/app.php` add the following to the aliases array:\n\n```php\n'Attendance' =\u003e CleaniqueCoders\\Attendance\\AttendanceFacade::class,\n```\n\n4. Install the package:\n\n```\n$ php artisan attendance:install\n```\n\n5. Setup `AttendanceTrait` to your user model.\n\n```php\n\u003c?php\n\nnamespace App;\n\nuse CleaniqueCoders\\Attendance\\Traits\\AttendanceTrait;\nuse Illuminate\\Notifications\\Notifiable;\nuse Illuminate\\Contracts\\Auth\\MustVerifyEmail;\nuse Illuminate\\Foundation\\Auth\\User as Authenticatable;\n\nclass User extends Authenticatable\n{\n    use Notifiable, AttendanceTrait;\n...\n```\n\n## Usage\n\n### Artisan Commands\n\nLog Attendance from console:\n\n```php\n// log user with 1 as time in\n$ php artisan attendance:log 1 1\n\n// log user with 1 as time out\n$ php artisan attendance:log 1 2\n\n// log user with email hi@attendance.com as time in\n$ php artisan attendance:log \"hi@attendance.com\" 1 \"email\"\n\n// log user with email hi@attendance.com as time out\n$ php artisan attendance:log \"hi@attendance.com\" 2 \"email\"\n```\n\n### API\n\nWhen running `attendance:install`, API routes to for attendance will be append into your `routes/api.php` file.\n\n### Scopes\n\nTo get all entries for today, you can use `todayEntries()` scope.\n\n```php\n\\CleaniqueCoders\\Attendance\\Models\\Attendance::todayEntries()-\u003eget();\n```\n\nTo get based on one or more drivers.\n\n```php\n\\CleaniqueCoders\\Attendance\\Models\\Attendance::todayEntries('web')-\u003eget();\n\\CleaniqueCoders\\Attendance\\Models\\Attendance::todayEntries(['api', 'access-card'])-\u003eget();\n```\n\n### Custom adapter\n\nYou can create custom adapter if you want to have custom integration with Slack, Telegram, etc.\n\n```\n$ php artisan make:attendance SlackAdapter --driver=slack\n```\n\nThis will create a class located at `app/Adapters/SlackAdapter.php`.\n\n```php\n\u003c?php \n\nnamespace App\\Adapters;\n\nuse CleaniqueCoders\\Attendance\\Models\\AttendanceType;\n\nclass SlackAdapter extends BaseAdapter\n{\n\tprotected $driver = 'slack';\n\n\tpublic function timeIn()\n\t{\n\t\t// your implementation to determine user is time in\n\t\t$this-\u003ecapture(AttendanceType::TIME_IN);\n\t}\n\n\tpublic function timeOut()\n\t{\n\t\t// your implementation to determine user is time out\n\t\t$this-\u003ecapture(AttendanceType::TIME_OUT);\n\t}\n}\n```\n\nOnce created, you may want to create routes to accept Slack webhook into your app. Following is an example of route setup.\n\n```php\nRoute::get('attendance/slack/time-in', function() {\n\t$user = \\App\\User::whereSlackId(request()-\u003eslack_id)-\u003efirstOrFail();\n\t(new \\App\\Adapters\\SlackAdapter($user, now()))-\u003etimeIn();\n})-\u003ename('attendance.slack.time-in');\n\nRoute::get('attendance/slack/time-out', function() {\n\t$user = \\App\\User::whereSlackId(request()-\u003eslack_id)-\u003efirstOrFail();\n\t(new \\App\\Adapters\\SlackAdapter($user, now()))-\u003etimeOut();\n})-\u003ename('attendance.slack.time-out');\n```\n\n## Test\n\nRun the following command:\n\n```\n$ vendor/bin/phpunit  --testdox --verbose\n```\n\n## Contributing\n\nThank you for considering contributing to the `cleaniquecoders/attendance`!\n\n### Bug Reports\n\nTo encourage active collaboration, it is strongly encourages pull requests, not just bug reports. \"Bug reports\" may also be sent in the form of a pull request containing a failing test.\n\nHowever, if you file a bug report, your issue should contain a title and a clear description of the issue. You should also include as much relevant information as possible and a code sample that demonstrates the issue. The goal of a bug report is to make it easy for yourself - and others - to replicate the bug and develop a fix.\n\nRemember, bug reports are created in the hope that others with the same problem will be able to collaborate with you on solving it. Do not expect that the bug report will automatically see any activity or that others will jump to fix it. Creating a bug report serves to help yourself and others start on the path of fixing the problem.\n\n## Coding Style\n\n`cleaniquecoders/attendance` follows the PSR-2 coding standard and the PSR-4 autoloading standard. \n\nYou may use PHP CS Fixer in order to keep things standardised. PHP CS Fixer configuration can be found in `.php_cs`.\n\n## License\n\nThis package is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcleaniquecoders%2Fattendance","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcleaniquecoders%2Fattendance","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcleaniquecoders%2Fattendance/lists"}