zedmagdy/filament-business-hours
Composer 安装命令:
composer require zedmagdy/filament-business-hours
包简介
A filament package for managing business hours with timezone support and exceptions.
README 文档
README
A Filament plugin for managing business hours with timezone support, multiple time slots per day, and exception handling.
Installation
composer require zedmagdy/filament-business-hours
Setup
1. Register the Plugin
In your Filament panel provider:
use ZEDMagdy\FilamentBusinessHours\FilamentBusinessHoursPlugin; ->plugins([ FilamentBusinessHoursPlugin::make() ->timezone('Asia/Riyadh'), // optional ])
2. Add Database Columns
Add a JSON column to your model's table:
Schema::table('branches', function (Blueprint $table) { $table->json('business_hours')->nullable(); });
3. Configure Your Model
use ZEDMagdy\FilamentBusinessHours\Traits\HasBusinessHours; class Branch extends Model { use HasBusinessHours; protected function casts(): array { return [ 'business_hours' => 'array', ]; } }
Usage
Form Field
use ZEDMagdy\FilamentBusinessHours\Forms\Components\BusinessHoursField; BusinessHoursField::make('business_hours') ->timezone() // show timezone selector (default: true) ->allowExceptions() // show exceptions section (default: true) ->collapsible() // collapsible day sections (default: true) ->defaultTimezone('UTC') // default timezone for new records ->columnSpanFull()
Table Column
use ZEDMagdy\FilamentBusinessHours\Tables\Columns\BusinessHoursColumn; // Status badge (Open/Closed) BusinessHoursColumn::make('business_hours') ->statusMode() // Weekly schedule grid BusinessHoursColumn::make('business_hours') ->scheduleMode()
Infolist Entry
use ZEDMagdy\FilamentBusinessHours\Infolists\Components\BusinessHoursEntry; // Full schedule with exceptions BusinessHoursEntry::make('business_hours') ->fullMode() // Status badge only BusinessHoursEntry::make('business_hours') ->statusMode() // Compact single-line BusinessHoursEntry::make('business_hours') ->compactMode()
Model Methods
$branch = Branch::first(); $branch->isOpen(); // true/false (current time) $branch->isClosed(); // true/false $branch->isOpenOn('monday'); // true/false $branch->isClosedOn('sunday'); // true/false $branch->nextOpen(); // Carbon instance $branch->nextClose(); // Carbon instance $branch->getBusinessTimezone(); // string
Configuration
Publish the config file:
php artisan vendor:publish --tag="filament-business-hours-config"
License
MIT
zedmagdy/filament-business-hours 适用场景与选型建议
zedmagdy/filament-business-hours 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 570 次下载、GitHub Stars 达 1, 最近一次更新时间为 2026 年 04 月 02 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「laravel」 「opening-hours」 「filament」 「business-hours」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 zedmagdy/filament-business-hours 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 zedmagdy/filament-business-hours 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 zedmagdy/filament-business-hours 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A helper to query and format a set of opening hours
A helper to query and format a set of opening hours based on Opening hours by spatie
A helper to query and format a set of opening hours, clone of spatie/opening-hours
Alfabank REST API integration
Renders business opening-hours in different formats from a ISO formatted string
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.
统计信息
- 总下载量: 570
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 11
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-04-02