label84/laravel-hours-helper
Generate Laravel Collections of time/date intervals between start and end with a given step. Customize output formatting, handle ranges crossing midnight or spanning days, and exclude specific intervals—ideal for meeting schedulers, calendars, and dropdown time selectors.
Collection and Carbon ecosystems, ensuring consistency with existing date/time logic. The facade (HoursHelper) adheres to Laravel conventions, reducing developer onboarding time.Collection output enables seamless integration with Blade, APIs, Livewire, or Inertia without additional processing.Carbon for parsing/formatting, ensuring consistency with existing date/time logic. Minimizes friction for teams already using Carbon.23:00 to 01:00).[['09:00', '09:59']]).HoursHelper calls with timezone-aware Carbon parsing (e.g., Carbon::parse($time, $appTimezone)).Cache::remember).start/end/interval values. Mitigation strategies:
after:start, before:end).spatie/laravel-calendar) if we adopt both?Collection, Carbon, and facades.Illuminate\Support\Collection, making it ideal for REST/GraphQL APIs where time intervals need to be serialized.assertContains for Collection assertions).HoursHelper to validate integration and performance.Carbon for parsing/formatting, ensuring consistency with existing date/time logic.HoursHelper facade aligns with Laravel’s service container and facade patterns, requiring no additional configuration.composer require label84/laravel-hours-helper).HoursHelper::create() calls.for loop generating 30-minute slots into $hours = HoursHelper::create('08:00', '17:00', 30).HoursHelper::create('23:00', '01:00', 60)).generateBusinessHours()).Collection, Carbon, facades), making it easier to debug and support.How can I help you explore Laravel packages today?