Download the PHP package aurorawebsoftware/acalendar without Composer
On this page you can find all versions of the php package aurorawebsoftware/acalendar. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download aurorawebsoftware/acalendar
More information about aurorawebsoftware/acalendar
Files in aurorawebsoftware/acalendar
Package acalendar
Short Description This is my package acalendar
License MIT
Homepage https://github.com/aurorawebsoftware/acalendar
Informations about the package acalendar
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
- 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
-
Install the package via Composer:
-
Publish the configuration and migration files:
- Execute the migrations:
Enums
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
DAY
: Event repeats daily.WEEK
: Event repeats weekly.MONTH
: Event repeats monthly.YEAR
: Event repeats yearly.
Integration with Models
Implement the EventableModelContract
and use the HasEvents
trait within your model:
Usage Examples
Creating Events
Only one event can be created for a model with a key
Retrieving Event Instances
-
Dynamic method on an instance:
- Static method on the model class:
Handling Repeating Events
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.
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
Conferences often last the entire day. Here's how you might set up an all-day event for a conference:
Webinar: Date Range Event
Webinars can span multiple days. This example demonstrates creating an event that covers a range of dates:
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:
Querying and Displaying Event Instances
Displaying Upcoming Conferences
Retrieve and display all upcoming conferences for the next year:
Webinar Schedule for the Next Month
Generate a schedule of all webinars happening in the next month, grouped by day:
Exhibition Hours
For exhibitions, it might be useful to know the exact opening and closing times:
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.
All versions of acalendar with dependencies
spatie/laravel-package-tools Version ^1.14.0
illuminate/contracts Version ^10.0