config/) or dynamically fetched (e.g., from a database/API)?Yasumi\Yasumi::load() for static data, Yasumi\Holiday::isHoliday() for checks).Carbon instances) to use Yasumi’s API.composer why-not or composer validate.DateTime, so ensure your app’s timezone settings (e.g., config/app.php) align with holiday definitions.config/holidays.php or external files.Yasumi::load('path/to/holidays.json');
Yasumi into services via Laravel’s container:
public function __construct(private Yasumi $yasumi) {}
if ($date->isHoliday())) with:
$this->yasumi->isHoliday($date, 'US');
public function test_holiday_detection() {
$this->assertTrue(Yasumi::isHoliday('2023-12-25', 'US')); // Christmas
}
holidays/US.json) to track changes.APP_HOLIDAY_REGION).composer.json if stability is critical.Yasumi::isValidDate().load() is called with the correct locale.Xdebug if calculations are slow.dd(Yasumi::holidays()) to inspect loaded data.$cacheKey = "holidays:US:{$date->format('Y-m-d')}";
return Cache::remember($cacheKey, now()->addDay(), fn() => $this->yasumi->isHoliday($date, 'US'));
holidays table, add:
CREATE INDEX idx_holiday_date_region ON holidays(date, region);
| Failure Scenario | Impact | Mitigation |
|---|---|---|
| St |
How can I help you explore Laravel packages today?