Calendar
Calendar is a Laravel Enso package designed for the management of calendars and calendar events
This package works exclusively within the Enso ecosystem.
For live examples and demos, you may visit laravel-enso.com
click on the photo to view a large size screenshot
Installation
install the back-end API package using composer:
composer require laravel-enso/calendarinstall the front-end resources:
yarn add @enso-ui/calendaradd a calendar alias in
webpack.mix.jsunder thealiasobject:'@calendar': `${__dirname}/node_modules/@enso-ui/calendar/src/bulma`,in
resources/js/router.jsfile, verify thatRouteMergeris imported, or import itimport RouteMerger from '@core-modules/importers/RouteMerger';make sure
routeImporteris also importedimport routeImporter from '@core-modules/importers/routeImporter';then use
RouteMergerto import front-end assets using the alias defined inwebpack.mix.js(new RouteMerger(routes)) .add(routeImporter(require.context('@calendar/routes', false, /.*\.js$/))) .add(routeImporter(require.context('./routes', false, /.*\.js$/)));in
resources/js/app.jsimport the package's icons
import '@calendar/icons';
publish
CalendarServiceProviderand register your calendarsrun
yarn devornpm run dev
Icons
The package uses the following icons:
faCalendarAlt
Features
- allows you to add, edit and remove calendar and calendar events
- normal users can only make changes to their own calendars, while administrators and supervisors can edit all
- will be able to be add recurring events and even events spanning multiple days
- comes with an included calendar seeder which can be published and further customized
- beautiful & functional interface built on top of vue-cal
- can also use custom (pseudo) calendars, so you can represent within the calendar events generated from other modules of the application
Usage
Configuration
The configuration file contains 2 sections:
calendarscalendarClasses
Custom Calendars
In addition to the calendars you can create from the UI, there is also the option to define custom calendars, which you can use to display information in the calendar, information retrieved from other sources.
One such example custom calendar is included in the package by default. This calendar displays persons' birthdays.
To activate/use it, first publish the package's calendar provider using:
php artisan vendor:publish --tag=calendar-provider
Then, include the custom calendar implementation in the provider's register property:
protected $register = [
BirthdayCalendar::class,
];
Creating Custom Calendars
In order to create custom calendars, just three steps are necessary:
- create a
CustomCalendarimplementation, for your calendar - create a
ProvidesEventimplementation for your calendar's events - register the new calendar implementation within the published
CalendarServiceProvider
Commands
php artisan enso:calendar:notify- sends the calendar event reminder notifications
The package is also using the command internally, as it calls it every minute to send any pending reminders.
Publishes
php artisan vendor:publish --tag=calendar-config- the configurationphp artisan vendor:publish --tag=enso-config- a common alias for when wanting to update the config, once a newer version is released, can be used with the--forceflagphp artisan vendor:publish --tag=calendar-provider- a default calendar providerphp artisan vendor:publish --tag=calendar-factory- a calendar factoryphp artisan vendor:publish --tag=enso-factories- a common alias for when wanting to update the factories once a newer version is released, usually used with the--forceflagphp artisan vendor:publish --tag=calendar-email-template- the email template, so you can customize itphp artisan vendor:publish --tag=enso-mail- a common alias for when wanting to update the email templates once a newer version is released, usually used with the--forceflag
Contributions
are welcome. Pull requests are great, but issues are good too.
License
This package is released under the MIT license.
← Cli Categories →