PHPackages                             ianvizarra/attendance - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. ianvizarra/attendance

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

ianvizarra/attendance
=====================

Attendance package for Laravel application.

v0.1.1(3y ago)1142[1 PRs](https://github.com/ianvizarra/attendance/pulls)MITPHPPHP ^8.0|^8.1

Since Nov 5Pushed 3y ago1 watchersCompare

[ Source](https://github.com/ianvizarra/attendance)[ Packagist](https://packagist.org/packages/ianvizarra/attendance)[ Docs](https://github.com/ianvizarra/attendance)[ Fund](https://www.paypal.me/ianvizarra)[ GitHub Sponsors](https://github.com/ianvizarra)[ RSS](/packages/ianvizarra-attendance/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (13)Versions (3)Used By (0)

Attendance package for Laravel applications.
============================================

[](#attendance-package-for-laravel-applications)

[![Latest Version on Packagist](https://camo.githubusercontent.com/a44e4a4dbd371b181520a23b113e52bbb7fd36984d9711631a929d88aa7945d7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f69616e76697a617272612f617474656e64616e63652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ianvizarra/attendance)[![GitHub Tests Action Status](https://camo.githubusercontent.com/9efa726ed97163bf52eb0797d0c079a6543723bce279a8bf25c4f578b6876eeb/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f69616e76697a617272612f617474656e64616e63652f74657374733f6c6162656c3d7465737473)](https://github.com/ianvizarra/attendance/actions?query=workflow%3Atests+branch%3Amaster)[![Total Downloads](https://camo.githubusercontent.com/d5babcd3d1c9ac4c6d030c52f1cb1f9458870440032b18c706ec5a1cc4860f95/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f69616e76697a617272612f617474656e64616e63652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ianvizarra/attendance)

Add Attendance feature with ease to your laravel application.

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

[](#installation)

You can install the package via composer:

```
composer require ianvizarra/attendance
```

You can publish and run the migrations with:

```
php artisan vendor:publish --tag="attendance-migrations"
php artisan migrate
```

You can publish the config file with:

```
php artisan vendor:publish --tag="attendance-config"
```

This is the contents of the published config file:

```
return [
  'logs_table' => 'attendance_logs',
    'schedule' => [
        'timeIn' => 9,
        'timeOut' => 17,
        'requiredDailyHours' => 8,
        'timeInAllowance' => 30, // minutes

        'workDays' => [
            'Monday',
            'Tuesday',
            'Wednesday',
            'Thursday',
            'Friday'
        ],
        'offDays' => [
            'Saturday',
            'Sunday'
        ]
    ],
    'user_model' => config('auth.providers.users.model', \App\Models\User::class),
    'users_table' => 'users'
];
```

Add `CanLogAttendance` Interface and `HasAttendance` Trait to your User model.

```
class User extends Authenticatable implements CanLogAttendance
{
    use HasAttendance;
}
```

Usage
-----

[](#usage)

Using User Model

```
$user->attendance(); // HasMany relationship to attendance log model

$user->timeIn(); // create an time-in attendance log entry

$user->timeOut(); // create an time-out attendance log entry

$user->hasTimeIn(); // return true if user already time-in for today
$user->hasTimeOut(); // return true if user already time-out for today
$user->hasWorked(); // return true if user already time-in and time-out for today
$user->getTimeIn(); // return the time-in attendance log for today

$user->logAttendance('in', 'on-time', now()); // manually log an attendance by type, status and time
```

Using Facade

```
use Ianvizarra\Attendance\Facades\Attendance;

 // create an attendance log entry for the currently logged-in user
 // by default it will the current time
 Attendance::timeIn();
 Attendance::timeOut();

 // manually set the time logged instead of the current time
 Attendance::timeIn(now()->subMinutes(30));

 // manually set the schedule configuration
 // the default config values can be found in config/attendance.php `config('attendance.schedule.hours')`
 Attendance::timeIn(now(), [
    'timeIn' => 8,
    'timeOut' => 16,
    'requiredDailyHours' => 8
]);

 // manually set the user other than the logged-in user
 Attendance::setUser($user)->timeIn();

 // get the time in status
 Attendance::timeInStatus(); // on-time, late
 // manually set the time using Carbon instance
 Attendance::timeInStatus(now()->subMinutes(30)); // on-time, late
  // manually set the schedule configuration
 Attendance::timeInStatus(now(), [
    'timeIn' => 8,
    'timeOut' => 16,
    'requiredDailyHours' => 8
]); // on-time, late

 // get the time out status
 Attendance::timeOutStatus(); // on-time, under-time
 // manually set the time using Carbon instance
 Attendance::timeOutStatus(now()->subMinutes(30)); // on-time, under-time
 // manually set the schedule configuration
 Attendance::timeOutStatus(now(), [
    'timeIn' => 8,
    'timeOut' => 16,
    'requiredDailyHours' => 8
]); // on-time, under-time
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Ian Vizarra](https://github.com/ianvizarra)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~6 days

Total

2

Last Release

1277d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2e3f0099046565cf60ab305c95fac84b39359f5d8cb109b3a9d864a0f55e404f?d=identicon)[ianvizarra](/maintainers/ianvizarra)

---

Top Contributors

[![ianvizarra](https://avatars.githubusercontent.com/u/2890710?v=4)](https://github.com/ianvizarra "ianvizarra (30 commits)")

---

Tags

laravelpackageattendanceianvizarra

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/ianvizarra-attendance/health.svg)

```
[![Health](https://phpackages.com/badges/ianvizarra-attendance/health.svg)](https://phpackages.com/packages/ianvizarra-attendance)
```

###  Alternatives

[spatie/laravel-data

Create unified resources and data transfer objects

1.7k28.9M627](/packages/spatie-laravel-data)[hirethunk/verbs

An event sourcing package that feels nice.

513162.9k6](/packages/hirethunk-verbs)[worksome/exchange

Check Exchange Rates for any currency in Laravel.

123544.7k](/packages/worksome-exchange)[ralphjsmit/livewire-urls

Get the previous and current url in Livewire.

82270.3k4](/packages/ralphjsmit-livewire-urls)[hydrat/filament-table-layout-toggle

Filament plugin adding a toggle button to tables, allowing user to switch between Grid and Table layouts.

6292.3k1](/packages/hydrat-filament-table-layout-toggle)[ralphjsmit/laravel-helpers

A package containing handy helpers for your Laravel-application.

13704.6k2](/packages/ralphjsmit-laravel-helpers)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
