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

Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future. Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future.
Community Partners