Category: api

When it comes to holiday dates, you may already know that some of the dates can be fixed and some change every year. Hence, storing these dates as fixed dates in a DB for retrieval is not possible.

You will receive a JSON response which you can parse and save it in your DB.

I would suggest including a CRON which updates the dates for each holiday in your DB for every next year at a time just before the start of that year (ex. On 31st Dec, 23:55:00).

CURLOPT_URL => ‘https://www.googleapis.com/calendar/v3/calendars/en.indian%23holiday%40group.v.calendar.google.com/events?key=your_project_key', CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => ‘’, CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, )); $response = curl_exec($curl); curl_close($curl); $response=json_decode($response); $forYear=date(‘Y’,strtotime(‘next year’)); //year for which you want to fetch dates.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge. Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge.
Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Shirts painstakingly handcrafted by under-caffeinated developers. Shirts painstakingly handcrafted by under-caffeinated developers.
Community Partners