PHPackages                             t1k3/laravel-calendar-event - 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. t1k3/laravel-calendar-event

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

t1k3/laravel-calendar-event
===========================

Laravel Calendar Event

0.2.1(6y ago)124545MITPHPPHP &gt;=7.1.3

Since Jun 26Pushed 6y ago1 watchersCompare

[ Source](https://github.com/t1k3/laravel-calendar-event)[ Packagist](https://packagist.org/packages/t1k3/laravel-calendar-event)[ RSS](/packages/t1k3-laravel-calendar-event/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (3)Dependencies (7)Versions (6)Used By (0)

Laravel Calendar Event
======================

[](#laravel-calendar-event)

[![Latest Stable Version](https://camo.githubusercontent.com/bad8ed05b3cfb255773472cf0d71d13f6aec052d48630053926134f77b9f90b2/68747470733a2f2f706f7365722e707567782e6f72672f74316b332f6c61726176656c2d63616c656e6461722d6576656e742f762f737461626c65)](https://packagist.org/packages/t1k3/laravel-calendar-event)[![Total Downloads](https://camo.githubusercontent.com/01c3d3b643de936335d9fe9bf71ff064dfe6580e48a64d2c83fcdd59819775c1/68747470733a2f2f706f7365722e707567782e6f72672f74316b332f6c61726176656c2d63616c656e6461722d6576656e742f646f776e6c6f616473)](https://packagist.org/packages/t1k3/laravel-calendar-event)[![License](https://camo.githubusercontent.com/11764b272f37dd70b40fa1560a1bb0df0f6be6a21a6355e9f7c020c064b311e8/68747470733a2f2f706f7365722e707567782e6f72672f74316b332f6c61726176656c2d63616c656e6461722d6576656e742f6c6963656e7365)](https://packagist.org/packages/t1k3/laravel-calendar-event)[![Build Status](https://camo.githubusercontent.com/40e3a0d4073dfe112bb01f54fb4fdd77d4c00534b3d1321b741cf97539916695/68747470733a2f2f7472617669732d63692e6f72672f74316b332f6c61726176656c2d63616c656e6461722d6576656e742e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/t1k3/laravel-calendar-event)[![codecov](https://camo.githubusercontent.com/0e7fb9e3cd8a380a1dd61305c7cd3a3e4dde12d7473e5ad9ce3116c0ac073ce4/68747470733a2f2f636f6465636f762e696f2f67682f74316b332f6c61726176656c2d63616c656e6461722d6576656e742f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/t1k3/laravel-calendar-event)[![Maintainability](https://camo.githubusercontent.com/5c41c933cfe43c4ceced0e1e7f13e10a01d8e8b98c55a3fa2da7c7ebae088e90/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f63323236616535336338323966323536656335382f6d61696e7461696e6162696c697479)](https://codeclimate.com/github/t1k3/laravel-calendar-event/maintainability)

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

[](#installation)

```
composer require t1k3/laravel-calendar-event
```

After updating composer, add the ServiceProvider to the providers array in `config/app.php`

```
T1k3\LaravelCalendarEvent\ServiceProvider::class,
```

You need publish to the config.

```
php artisan vendor:publish --provider="T1k3\LaravelCalendarEvent\ServiceProvider"
```

You need to run the migrations for this package.

```
php artisan migrate
```

Usage
-----

[](#usage)

#### Recurring options

[](#recurring-options)

- DAY
- WEEK
- MONTH
- YEAR
- NTHWEEKDAY: nth weekday per month, example 2nd Monday

#### Create CalendarEvent

[](#create-calendarevent)

If you like to attach `User` and/or `Place` then must have:

- configurate `config/calendar-event.php`
- implements `UserInterface`, `PlaceInterface` on your Models
- you can use `CalendarEventUserTrait`, `CalendarEventPlaceTrait` in Models

```
use T1k3\LaravelCalendarEvent\Interfaces\PlaceInterface;
use T1k3\LaravelCalendarEvent\Traits\CalendarEventPlaceTrait;

class Place extends Model implements PlaceInterface
{
    use CalendarEventPlaceTrait;
}
```

```
use T1k3\LaravelCalendarEvent\Models\CalendarEvent;
use T1k3\LaravelCalendarEvent\Enums\RecurringFrequenceType;

$calendarEvent = new CalendarEvent();
$calendarEvent = $calendarEvent->createCalendarEvent([
    'title'                         => 'Lorem ipsum',
    'start_datetime'                => Carbon::parse('2017-08-25 16:00:00'),
    'end_datetime'                  => Carbon::parse('2017-08-25 17:30:00'),
    'description'                   => 'Lorem ipsum dolor sit amet',
    'is_recurring'                  => true,
    'frequence_number_of_recurring' => 1,
    'frequence_type_of_recurring'   => RecurringFrequenceType::WEEK,
    'is_public'                     => true,
    'end_of_recurring'              => Carbon::parse('2017-09-08')
], $user = null, $place = null);
```

#### Edit and Update CalendarEvent

[](#edit-and-update-calendarevent)

```
$calendarEvent        = CalendarEvent::find($id);
$calendarEventUpdated = $calendarEvent->editCalendarEvent([
    'start_datetime' => Carbon::parse('2017-08-26'),
    'is_recurring'   => false,
], $user = null, $place = null);

// $calendarEventUpdated === null ? dd('NOT_MODIFIED') : dd('MODIFIED', $calendarEventUpdated);
```

#### Update CalendarEvent (without data check)

[](#update-calendarevent-without-data-check)

```
$calendarEvent        = CalendarEvent::find($id);
$calendarEventUpdated = $calendarEvent->updateCalendarEvent([
    'start_datetime' => Carbon::parse('2017-08-26'),
    'is_recurring'   => false,
], $user = null, $place = null);
```

#### Delete CalendarEvent

[](#delete-calendarevent)

```
$calendarEvent = CalendarEvent::find($id);
$isDeleted     = $calendarEvent->deleteCalendarEvent($isRecurring = null);
```

#### Edit and Update not existing CalendarEvent

[](#edit-and-update-not-existing-calendarevent)

```
use T1k3\LaravelCalendarEvent\Models\TemplateCalendarEvent;

$templateCalendarEvent = TemplateCalendarEvent::find($id);
$calendarEventUpdated  = $templateCalendarEvent->editCalendarEvent(Carbon::parse('2017-08-30'), [
    'description' => 'Foo Bar'
], $user = null, $place = null);

// $calendarEventUpdated === null ? dd('NOT_MODIFIED') : dd('MODIFIED', $calendarEventUpdated);
```

#### Update not existing CalendarEvent (without data check)

[](#update-not-existing-calendarevent-without-data-check)

```
use T1k3\LaravelCalendarEvent\Models\TemplateCalendarEvent;

$templateCalendarEvent = TemplateCalendarEvent::find($id);
$calendarEventUpdated  = $templateCalendarEvent->updateCalendarEvent(Carbon::parse('2017-08-30'), [
    'description' => 'Foo Bar'
], $user = null, $place = null);
```

#### Delete not existing CalendarEvent

[](#delete-not-existing-calendarevent)

```
$templateCalendarEvent = TemplateCalendarEvent::find($id);
$isDeleted             = $templateCalendarEvent->deleteCalendarEvent(Carbon::parse('2017-08-30'), $isRecurring = null);
```

#### Get (potential) CalendarEvent(s) of month

[](#get-potential-calendarevents-of-month)

If the CalendarEvent is not exist then it is append `is_not_exists` attribute with `true` value

```
$calendarEvents = CalendarEvent::showPotentialCalendarEventsOfMonth(Carbon::parse('2017-08'));
```

#### Generate next CalendarEvent(s) from Console

[](#generate-next-calendarevents-from-console)

Do NOT forget the [Laravel Task Scheduling](https://laravel.com/docs/master/scheduling)

- The command run at hourly in schedule

```
* * * * * php /path-to-your-project/artisan schedule:run >> /dev/null 2>&1
# OR manually
php artisan generate:calendar-event
```

### Validation

[](#validation)

Do NOT forget the [validation](https://laravel.com/docs/master/validation)

- start\_datetime
- end\_datetime

### How to upgrade Carbon

[](#how-to-upgrade-carbon)

```
$ docker run -it --rm -v $PWD:/app -w /app epcallan/php7-testing-phpunit:7.2-phpunit7 bash
$ composer install
$ ./vendor/bin/upgrade-carbon
```

### How to Testing

[](#how-to-testing)

```
$ docker run -it --rm -v $PWD:/app -w /app epcallan/php7-testing-phpunit:7.2-phpunit7 bash
$ composer install
$ ./vendor/bin/phpunit
```

### TODO

[](#todo)

- OCP
- Name conventions, example: `TemplateCalendarEvent::events()` to `TemplateCalendarEvent::calendarEvents()`
- [Custom validation rule](https://laravel.com/docs/master/validation#custom-validation-rules) to date/time diff

### Special thanks

[](#special-thanks)

- [Bit and Pixel](https://bitandpixel.hu)

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 78.8% 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 ~35 days

Total

3

Last Release

2491d ago

PHP version history (2 changes)0.1.0PHP &gt;=7.1

0.2.1PHP &gt;=7.1.3

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/8018130?v=4)[T1k3](/maintainers/t1k3)[@t1k3](https://github.com/t1k3)

---

Top Contributors

[![t1k3](https://avatars.githubusercontent.com/u/8018130?v=4)](https://github.com/t1k3 "t1k3 (26 commits)")[![rmenner](https://avatars.githubusercontent.com/u/3800380?v=4)](https://github.com/rmenner "rmenner (5 commits)")[![jmaloneytrevetts](https://avatars.githubusercontent.com/u/22198083?v=4)](https://github.com/jmaloneytrevetts "jmaloneytrevetts (2 commits)")

---

Tags

calendarlaraveleventlaravelcalendarlaravel-calendar-event

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/t1k3-laravel-calendar-event/health.svg)

```
[![Health](https://phpackages.com/badges/t1k3-laravel-calendar-event/health.svg)](https://phpackages.com/packages/t1k3-laravel-calendar-event)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.1M337](/packages/psalm-plugin-laravel)[wearepixel/laravel-cart

A cart implementation for Laravel

1355.6k](/packages/wearepixel-laravel-cart)

PHPackages © 2026

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