{"id":39305004,"url":"https://github.com/tomhatzer/nova-business-hours","last_synced_at":"2026-01-18T01:34:22.920Z","repository":{"id":40673491,"uuid":"347728171","full_name":"tomhatzer/nova-business-hours","owner":"tomhatzer","description":null,"archived":false,"fork":false,"pushed_at":"2022-12-14T01:37:47.000Z","size":2368,"stargazers_count":0,"open_issues_count":12,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-11T14:07:12.363Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Vue","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tomhatzer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-03-14T19:03:59.000Z","updated_at":"2021-03-15T21:46:54.000Z","dependencies_parsed_at":"2023-01-28T16:16:30.802Z","dependency_job_id":null,"html_url":"https://github.com/tomhatzer/nova-business-hours","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/tomhatzer/nova-business-hours","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomhatzer%2Fnova-business-hours","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomhatzer%2Fnova-business-hours/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomhatzer%2Fnova-business-hours/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomhatzer%2Fnova-business-hours/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tomhatzer","download_url":"https://codeload.github.com/tomhatzer/nova-business-hours/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomhatzer%2Fnova-business-hours/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28526550,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T00:39:45.795Z","status":"ssl_error","status_checked_at":"2026-01-18T00:39:39.467Z","response_time":85,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":[],"created_at":"2026-01-18T01:34:22.808Z","updated_at":"2026-01-18T01:34:22.886Z","avatar_url":"https://github.com/tomhatzer.png","language":"Vue","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Nova Business Hours Field\n\nThis package offers a field for Nova to easily manage your business hours.\n\n## Install\n\n```bash\ncomposer require tomhatzer/nova-business-hours\n```\n\n## Usage\n\nAdd this line to your Nova resource fields array:\n```php\nNovaBusinessHours::make('Business hours', 'business_hours'),\n```\n\n## Compatibility\n\n### Using this package with spatie/open-hours\n\nCreate a getter for your business hours field in your model like this:\n\n```php\npublic function getBusinessHoursAttribute($value)\n{\n    $jsonDecoded = json_decode($value);\n\n    return collect($jsonDecoded)-\u003etransform(function($day) {\n        return array_filter(\n            array_map(function($item) {\n                if($item-\u003eisOpen) {\n                    return substr_replace($item-\u003eopen, ':', 2, 0) . '-' . substr_replace($item-\u003eclose, ':', 2, 0);\n                }\n\n                return null;\n            }, $day)\n        );\n    })-\u003eall();\n}\n```\n\nIn this case the fields name will be `business_hours`. Customize this according to your database column name.\n\nAfterwards you can use it to fill the `OpeningHours` class with your existing business hours like this:\n\n```php\n// Add the use at the top of each file where you want to use the OpeningHours class:\nuse Spatie\\OpeningHours\\OpeningHours;\n\n// Get your model instance\n$model = Model::find(1);\n\n// Fill the OpeningHours class with your business hours\n$openingHours = OpeningHours::create($model-\u003ebusiness_hours);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomhatzer%2Fnova-business-hours","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftomhatzer%2Fnova-business-hours","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomhatzer%2Fnova-business-hours/lists"}