Download the PHP package fredbradley/annual-leave-widget without Composer
On this page you can find all versions of the php package fredbradley/annual-leave-widget. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download fredbradley/annual-leave-widget
More information about fredbradley/annual-leave-widget
Files in fredbradley/annual-leave-widget
Package annual-leave-widget
Short Description A Laravel package for displaying annual leave events from Google Calendar ICS feeds
License MIT
Informations about the package annual-leave-widget
Annual Leave Dashboard Widget
? A Laravel package for displaying annual leave events from Google Calendar ICS feeds in your Laravel 12/13 application.
Requirements
- PHP 8.5+
- Laravel 12.x or 13.x
Installation
Install the package via Composer:
The package will automatically register itself via Laravel's package auto-discovery.
Configuration
1. Publish the Configuration File (Optional)
If you want to customize the configuration, publish the config file:
This will create a config/annual_leave.php file in your application.
2. Add Your Google Calendar ICS URL
Add your Google Calendar ICS URL to your .env file:
How to Get Your Google Calendar ICS URL
- Open Google Calendar
- Click on the three dots next to the calendar you want to share
- Select "Settings and sharing"
- Scroll down to "Integrate calendar"
- Copy the "Secret address in iCal format" URL

3. Optional Environment Variables
You can also configure the following in your .env file:
Usage
Basic Usage
Once installed and configured, the package automatically registers a route at /annual-leave that displays the widget.
Visit: https://your-app.test/annual-leave
Custom Views
If you want to customize the view, publish the views:
This will create views in resources/views/vendor/annual-leave/ which you can customize.
Using the Widget in Your Own Views
You can also include the widget in your own views:
To get the events in your controller:
JSON API Endpoint
The package also provides a JSON API endpoint for consuming applications:
Endpoint: GET /annual-leave/json
Response Format:
Error Response:
Using the JSON API:
Styling
The widget outputs HTML with the following structure:
You can add your own CSS to style the widget. Events that are currently active (today is between start and end dates) will have the today class applied to the <tr> element.
Configuration Options
The config/annual_leave.php file contains the following options:
| Option | Environment Variable | Default | Description |
|---|---|---|---|
google_calendar_ics_uri |
GOOGLE_CALENDAR_ICS_URI |
null |
The URL to your Google Calendar ICS file |
timezone |
ANNUAL_LEAVE_TIMEZONE |
Europe/London |
Default timezone for parsing events |
max_events |
ANNUAL_LEAVE_MAX_EVENTS |
12 |
Maximum number of upcoming events to display |
enable_routes |
ANNUAL_LEAVE_ENABLE_ROUTES |
true |
Whether to automatically register routes |
route_prefix |
ANNUAL_LEAVE_ROUTE_PREFIX |
annual-leave |
URL prefix for package routes |
route_middleware |
N/A | [] |
Middleware to apply to routes (set in config file) |
License
This package is open-sourced software. Please check the repository for license information.
Credits
All versions of annual-leave-widget with dependencies
illuminate/support Version ^12.0|^13.0
illuminate/routing Version ^12.0|^13.0
illuminate/view Version ^12.0|^13.0