LaravelPackages.net
Acme Inc.
Toggle sidebar
aharen/calendar

Calendar generator with optional events for Laravel

54
2
v1.0.2
About aharen/calendar

aharen/calendar is a Laravel package for calendar generator with optional events for laravel. It currently has 2 GitHub stars and 54 downloads on Packagist (latest version v1.0.2). Install it with composer require aharen/calendar. Discover more Laravel packages by aharen or browse all Laravel packages to compare alternatives.

Last updated

Calendar

Calendar generator with optional events for Laravel

Installation

composer require aharen/calendar

Configuration

Add aharen\Clendar\CalendarServiceProvider::class to the end of providers in config/app.php

Usage

$calendar = new Calendar();
$calendar->month('2016-08')
    ->generate()
    ->withEvents(false);

The method withEvents() when empty or set true will return events with 30 minute interval time array.

Adding Events to Calendar

There are two methods for adding Events to the calendar.

  1. addEvent($time, $event)

$time - formatted as H:i or accepts the string all_day eg: $calendar->addEvent('04:30', 'Early morning walk'); $event - accepts a string as your event detail

eg:  `$calendar->days['05-08']->addEvent('08:00', 'that cool project goes live');`
  1. addAllDay($event)

$event - accepts a string as your event detail

eg: `$calendar->days['05-08']->addAllDay('Sleep all day');`

Star History Chart