PHP code example of fredbradley / annual-leave-widget
1. Go to this page and download the library: Download fredbradley/annual-leave-widget library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
fredbradley / annual-leave-widget example snippets
use CranleighSchool\AnnualLeave\IcsParser;
public function myMethod()
{
$parser = new IcsParser(config('annual_leave.google_calendar_ics_uri'));
$events = $parser->parse();
return view('your-view', compact('events'));
}
// PHP/Laravel HTTP Client example
$response = Http::get('https://your-app.test/annual-leave/json');
$events = $response->json('events');
bash
php artisan vendor:publish --tag=annual-leave-config
bash
php artisan vendor:publish --tag=annual-leave-views