PHPackages                             aurorawebsoftware/acalendar - 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. aurorawebsoftware/acalendar

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

aurorawebsoftware/acalendar
===========================

This is my package acalendar

12.0.0(11mo ago)241.0k—0%2MITPHPPHP ^8.2|^8.3CI passing

Since Aug 1Pushed 11mo ago1 watchersCompare

[ Source](https://github.com/AuroraWebSoftware/ACalendar)[ Packagist](https://packagist.org/packages/aurorawebsoftware/acalendar)[ Docs](https://github.com/aurorawebsoftware/acalendar)[ RSS](/packages/aurorawebsoftware-acalendar/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (7)Dependencies (12)Versions (14)Used By (2)

**Laravel ACalendar Package**
=============================

[](#laravel-acalendar-package)

The Laravel ACalendar package is designed to enrich Laravel applications with advanced event management capabilities. It allows developers to seamlessly integrate event functionalities into Eloquent models, manage event occurrences, and handle repeating events with ease. This guide outlines the package's main features, installation process, and usage with detailed examples.

**Features and Main Concepts**
------------------------------

[](#features-and-main-concepts)

- **Flexible Event Management**: Create, update, and delete events directly associated with Eloquent models.
- **Support for Various Event Types**: Handles different types of events, including single, all-day, ranged dates, and timed events.
- **Repeating Events**: Comprehensive support for repeating events with customizable frequencies.
- **Eloquent Model Integration**: Easy integration with any Eloquent model using a trait and interface.
- **Dynamic Event Instances Generation**: Automatically handles the generation of event instances for repeating events within specified date ranges.
- **Custom Event Collection Method**: Provides a **`byDay()`** method for grouping event instances, facilitating calendar views or daily summaries.

**Installation**
----------------

[](#installation)

1. Install the package via Composer:

```
composer require aurorawebsoftware/acalendar
```

1. Publish the configuration and migration files:

```
php artisan vendor:publish --provider="AuroraWebSoftware\ACalendar\ACalendarServiceProvider"
```

1. Execute the migrations:

```
php artisan migrate
```

**Enums**
---------

[](#enums)

### **Type Enum**

[](#type-enum)

- **`DATE_ALL_DAY`**: Events occurring throughout the day.
- **`DATE_POINT`**: Events assigned to a specific date.
- **`DATETIME_POINT`**: Events assigned to a specific datetime.
- **`DATE_RANGE`**: Events spanning across multiple dates.
- **`DATETIME_RANGE`**: Events with a specific start and end datetime.

### **RepeatFrequency Enum**

[](#repeatfrequency-enum)

- **`DAY`**: Event repeats daily.
- **`WEEK`**: Event repeats weekly.
- **`MONTH`**: Event repeats monthly.
- **`YEAR`**: Event repeats yearly.

**Integration with Models**
---------------------------

[](#integration-with-models)

Implement the **`EventableModelContract`** and use the **`HasEvents`** trait within your model:

```
namespace App\Models;

use AuroraWebSoftware\ACalendar\Contracts\EventableModelContract;
use AuroraWebSoftware\ACalendar\Traits\HasEvents;
use Illuminate\Database\Eloquent\Model;

class Task extends Model implements EventableModelContract
{
    use HasEvents;

    protected $fillable = ['name'];

    public static function getModelType(): string
    {
        return self::class;
    }

    public function getModelId(): int
    {
        return $this->id;
    }

    public function getEventTitle(): ?string
    {
        return $this->name;
    }
}
```

**Usage Examples**
------------------

[](#usage-examples)

### **Creating Events**

[](#creating-events)

```
$task = Task::find(1);
$task->updateOrCreateEvent(
    key: 'deadline',
    type: Type::DATE_POINT,
    start: Carbon::tomorrow(),
    title: 'Preparing SRS Docs'
);

$task->updateOrCreateEvent(
    key: 'deadline',
    type: Type::DATE_POINT,
    start: Carbon::tomorrow(),
    title: 'Preparing SRS Docs'
);
```

> Only one event can be created for a model with a key

### **Retrieving Event Instances**

[](#retrieving-event-instances)

- Dynamic method on an instance:

```
$events = $task->eventInstances('deadline', Carbon::now(), Carbon::now()->addMonth(1));
```

- Static method on the model class:

```
$events = Task::allEventInstances('deadline', Carbon::now(), Carbon::now()->addMonth(1));
```

### **Handling Repeating Events**

[](#handling-repeating-events)

```
$meeting = Meeting::find(1);
$meeting->updateOrCreateEvent(
    key: 'Weekly Review',
    type: Type::DATETIME_POINT,
    start: Carbon::parse('next monday 10:00'),
    repeatFrequency: RepeatFrequency::WEEK,
    repeatPeriod: 1,
    title: 'Weekly Review Meeting'
);
```

### **Using `byDay` Method**

[](#using-byday-method)

The byDay() method in the Laravel ACalendar package groups event instances by their occurrence date, returning a collection where each key is a date and the value is a collection of events happening on that date. This method simplifies creating calendar views or daily schedules by organizing events in a date-indexed format, making it straightforward to display what events are happening on each day.

- Facilitates the development of calendar interfaces by categorizing events by day.

```
$eventInstances = $meeting->eventInstances(null, Carbon::now(), Carbon::now()->addWeeks(4));
$byDay = $eventInstances->byDay();

foreach ($byDay as $date => $events) {
    echo "Date: $date\n";
    foreach ($events as $event) {
        echo "- {$event->title} at {$event->start->format('H:i')}\n";
    }
}
```

**Scenario Setup**
------------------

[](#scenario-setup)

Assuming we have three models - **`Conference`**, **`Webinar`**, and **`Exhibition`**, each integrated with the ACalendar package as shown in previous examples. These models will demonstrate different event types, such as **`DATE_ALL_DAY`**, **`DATE_RANGE`**, and **`DATETIME_RANGE`**.

### **Conference: All-Day Event**

[](#conference-all-day-event)

Conferences often last the entire day. Here's how you might set up an all-day event for a conference:

```
$conference = Conference::create(['name' => 'Tech Innovators Conference', 'description' => 'A gathering of technology innovators.']);

$conference->updateOrCreateEvent(
    key: 'tech_innovators_2024',
    type: Type::DATE_ALL_DAY,
    start: Carbon::parse('2024-09-10'),
    title: 'Tech Innovators Conference - All Day'
);
```

### **Webinar: Date Range Event**

[](#webinar-date-range-event)

Webinars can span multiple days. This example demonstrates creating an event that covers a range of dates:

```
$webinar = Webinar::create(['title' => 'Digital Marketing 101', 'host' => 'Marketing Gurus']);

$webinar->updateOrCreateEvent(
    key: 'digital_marketing_101',
    type: Type::DATE_RANGE,
    start: Carbon::parse('2024-10-05'),
    end: Carbon::parse('2024-10-07'),
    title: 'Digital Marketing 101 Webinar'
);
```

### **Exhibition: DateTime Range Event**

[](#exhibition-datetime-range-event)

Exhibitions may have specific start and end times. Here's how you'd set up an event with a datetime range:

```
$exhibition = Exhibition::create(['name' => 'Artists of the 21st Century', 'location' => 'City Art Gallery']);

$exhibition->updateOrCreateEvent(
    key: '21st_century_artists',
    type: Type::DATETIME_RANGE,
    start: Carbon::parse('2024-11-20 09:00'),
    end: Carbon::parse('2024-11-20 17:00'),
    title: 'Artists of the 21st Century Exhibition'
);
```

**Querying and Displaying Event Instances**
-------------------------------------------

[](#querying-and-displaying-event-instances)

### **Displaying Upcoming Conferences**

[](#displaying-upcoming-conferences)

Retrieve and display all upcoming conferences for the next year:

```
phpCopy code
$upcomingConferences = Conference::allEventInstances(
    null,
    Carbon::now(),
    Carbon::now()->addYear(1)
);

foreach ($upcomingConferences as $event) {
    echo "Conference: {$event->title} on {$event->start->toDateString()}\n";
}
```

### **Webinar Schedule for the Next Month**

[](#webinar-schedule-for-the-next-month)

Generate a schedule of all webinars happening in the next month, grouped by day:

```
phpCopy code
$nextMonthWebinars = Webinar::allEventInstances(
    null,
    Carbon::now()->addMonth(),
    Carbon::now()->addMonths(2)
)->byDay();

foreach ($nextMonthWebinars as $date => $webinars) {
    echo "Date: $date\n";
    foreach ($webinars as $webinar) {
        echo "- Webinar: {$webinar->title} from {$webinar->start->toDateString()} to {$webinar->end->toDateString()}\n";
    }
}
```

### **Exhibition Hours**

[](#exhibition-hours)

For exhibitions, it might be useful to know the exact opening and closing times:

```
phpCopy code
$exhibitionDetails = Exhibition::allEventInstances('21st_century_artists', Carbon::now(), Carbon::now()->addMonth(1));

foreach ($exhibitionDetails as $detail) {
    echo "Exhibition: {$detail->title}, Start: {$detail->start->toDateTimeString()}, End: {$detail->end->toDateTimeString()}\n";
}
```

These examples illustrate just a few of the many possibilities enabled by the Laravel ACalendar package for managing events. By leveraging different event types and repeat frequencies, developers can tailor the package to meet a wide array of event management needs within their Laravel applications.

This Laravel ACalendar package guide aims to provide a solid foundation for integrating and utilizing event management within your Laravel applications. By following the installation instructions and exploring the comprehensive examples, you can leverage the package's functionalities to enhance your projects with sophisticated event handling capabilities.

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance51

Moderate activity, may be stable

Popularity26

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 92.6% 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 ~73 days

Recently: every ~105 days

Total

7

Last Release

345d ago

Major Versions

1.1.1 → 11.0.02024-12-11

11.0.0 → 12.0.02025-05-30

PHP version history (2 changes)1.0.0PHP ^8.2

11.0.0PHP ^8.2|^8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/e79935c219efe1a3132a4c9f2b87da38268fccacfcb43c453275ceafdd1ed23f?d=identicon)[emreakay](/maintainers/emreakay)

---

Top Contributors

[![emreakay](https://avatars.githubusercontent.com/u/794216?v=4)](https://github.com/emreakay "emreakay (25 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (1 commits)")

---

Tags

calendarcalendar-vieweventslaravellaravelAuroraWebSoftwareacalendar

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/aurorawebsoftware-acalendar/health.svg)

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

###  Alternatives

[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)
