{"id":37012610,"url":"https://github.com/rennokki/schedule","last_synced_at":"2026-01-14T01:12:22.403Z","repository":{"id":62534809,"uuid":"134363104","full_name":"rennokki/schedule","owner":"rennokki","description":"Schedule is a package that helps tracking schedules for your models. If you have workers in a company, you can set schedules for them and see their availability though the time.","archived":true,"fork":false,"pushed_at":"2019-11-21T18:45:43.000Z","size":56,"stargazers_count":156,"open_issues_count":1,"forks_count":15,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-11-01T05:20:40.567Z","etag":null,"topics":["eloquent","laravel","model","php","schedule","table","time","timetable","trait"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rennokki.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-05-22T05:04:41.000Z","updated_at":"2025-02-11T21:34:03.000Z","dependencies_parsed_at":"2022-11-02T15:01:30.232Z","dependency_job_id":null,"html_url":"https://github.com/rennokki/schedule","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/rennokki/schedule","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rennokki%2Fschedule","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rennokki%2Fschedule/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rennokki%2Fschedule/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rennokki%2Fschedule/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rennokki","download_url":"https://codeload.github.com/rennokki/schedule/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rennokki%2Fschedule/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28407658,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T00:40:43.272Z","status":"ssl_error","status_checked_at":"2026-01-14T00:40:42.636Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["eloquent","laravel","model","php","schedule","table","time","timetable","trait"],"created_at":"2026-01-14T01:12:21.852Z","updated_at":"2026-01-14T01:12:22.397Z","avatar_url":"https://github.com/rennokki.png","language":"PHP","funding_links":["https://paypal.me/rennokki"],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/rennokki/schedule.svg?branch=master)](https://travis-ci.org/rennokki/schedule)\n[![codecov](https://codecov.io/gh/rennokki/schedule/branch/master/graph/badge.svg)](https://codecov.io/gh/rennokki/schedule/branch/master)\n[![StyleCI](https://github.styleci.io/repos/134363104/shield?branch=master)](https://github.styleci.io/repos/134363104)\n[![Latest Stable Version](https://poser.pugx.org/rennokki/schedule/v/stable)](https://packagist.org/packages/rennokki/schedule)\n[![Total Downloads](https://poser.pugx.org/rennokki/schedule/downloads)](https://packagist.org/packages/rennokki/schedule)\n[![Monthly Downloads](https://poser.pugx.org/rennokki/schedule/d/monthly)](https://packagist.org/packages/rennokki/schedule)\n[![License](https://poser.pugx.org/rennokki/schedule/license)](https://packagist.org/packages/rennokki/schedule)\n\n[![PayPal](https://img.shields.io/badge/PayPal-donate-blue.svg)](https://paypal.me/rennokki)\n\n# Schedule\nSchedule is a package that helps tracking schedules for your models. If you have workers in a company, you can set schedules for them and see their availability though the time.\n\n# Inspiration\nThis package is inspired from [Spatie's Opening Hours](https://github.com/spatie/opening-hours) package, which uses a schedule but only statically, rather than binding it to a model. This gave me the idea of brining it closer to Eloquent Models than to the classic Class.\n\n# Installation\nInstall the package via Composer CLI:\n```bash\n$ composer require rennokki/schedule\n```\n\nFor versions of Laravel that doesn't support package discovery, you should add this to your `config/app.php` file, in the `providers` array:\n```php\n\\Rennokki\\Schedule\\ScheduleServiceProvider::class,\n```\n\nPublish the migration file and the config file.\n```bash\n$ php artisan vendor:publish\n```\n\nMigrate the database.\n```bash\n$ php artisan migrate\n```\n\nAdd the trait to your model.\n```php\nuse Rennokki\\Schedule\\Traits\\HasSchedule;\n\nclass User extends Model {\n    use HasSchedule;\n    ...\n}\n```\n\n# Getting Started\nTo get stared, let's create a schedule for our user. It will be from Monday to Friday, between 8-12 and 13-18.\n```php\n$user-\u003esetSchedule([\n    'monday' =\u003e ['08:00-12:00', '13:00-18:00'],\n    'tuesday' =\u003e ['08:00-12:00', '13:00-18:00'],\n    'wednesday' =\u003e ['08:00-12:00', '13:00-18:00'],\n    'thursday' =\u003e ['08:00-12:00', '13:00-18:00'],\n    'friday' =\u003e ['08:00-12:00', '13:00-18:00'],\n]);\n\n$user-\u003ehasSchedule(); // true\n```\n\nLet's  say the user has its birthday on 1st March each year, so let's add this to an exclusions list. Adding to this, the first and the second day of Christmas is free for anyone, and let's add 1st May 2018 in our exclusions list too. \n\nNote: 1st May 2018 will occur only once, it's not recurrent.\n```php\n$user-\u003esetExclusions([\n    '03-01' =\u003e ['08:00-12:00'],\n    '12-25' =\u003e [],\n    '12-26' =\u003e [],\n    '2018-05-01' =\u003e [],\n]);\n```\n\n# Checking for availability\nYou can check if the user has working hours on a certain day, date. Passing date also works with Carbon instance.\n```php\n$user-\u003eisAvailableOn('monday'); // true\n$user-\u003eisAvailableOn('05-28'); // true; This is Monday, in 2018 (current year)\n$user-\u003eisAvailableOn('2018-05-28'); // true\n$user-\u003eisAvailableOn(Carbon::create(2018, 5, 28, 0, 0, 0)); // true\n\n$user-\u003eisUnavailableOn('monday'); // false\n$user-\u003eisUnavailableOn('05-28'); // false\n$user-\u003eisUnavailableOn('2018-05-28'); // false\n$user-\u003eisUnavailableOn(Carbon::create(2018, 5, 28, 0, 0, 0)); // false\n```\n\nIf there is an exclusion that day, it will return the correct value based on the schedule set that day:\n```php\n$user-\u003eisUnavailableOn('12-25'); // true\n$user-\u003eisUnavailableOn('03-01'); // false\n```\n\n# Checking for availability at a certain time\nYou can also check availability for a certain time on a specific day.\n```php\n$user-\u003eisAvailableOnAt('monday', '09:00'); // true\n$user-\u003eisUnavailableOnAt('monday', '09:00'); // false\n```\n\n# Getting the amount of hours or minutes for a day\nYou can get the amount of hours or minutes scheduled for a day. Good for tracking workable hours, for example.\n```php\n$user-\u003egetHoursOn('03-01'); // 4\n$user-\u003egetHoursOn('12-26'); // 0\n$user-\u003egetHoursOn('05-28'); // 9\n$user-\u003egetHoursOn('2018-05-28'); // 9\n\n$user-\u003egetMinutesOn('03-01'); // 240\n```\n\n# Deleting the schedule\nIf you plan to delete the user's schedule, you can do so by calling `deleteSchedule()`.\n```php\n$user-\u003edeleteSchedule();\n$user-\u003ehasSchedule(); // false\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frennokki%2Fschedule","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frennokki%2Fschedule","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frennokki%2Fschedule/lists"}