承接 honortaker/laravel-holidays-de 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

honortaker/laravel-holidays-de

最新稳定版本:v1.0.0

Composer 安装命令:

composer require honortaker/laravel-holidays-de

包简介

Import german holidays into your laravel application

README 文档

README

This package provides tools to import german holidays into your laravel application using api-feiertage.de API.

Getting Started

  1. Run composer require honortaker/laravel-holidays-de to install the package
  2. Run php artisan migrate to apply the database scheme
  3. Run php artisan holidays:import to import holidays into the database
  4. Query holidays for your needs by using Holiday::query()

Database Scheme

To get started using german holidays in your application, you need to run the artisan migrate command. This package delivers a builtin migration that creates a table which will carry the information about the holidays.

The package allows you to set an alternative database table name for the model by changing values in the configuration file.

Import Holidays

After migrating your database, you can go ahead adn import the holiday information from the api using the HolidaysImportCommand:

php artisan holidays:import

By running the command, the holidays for the current year will be imported into the database.

Optionally you can pass in a specific year into the command:

php artisan holidays:import 2025

Query Holidays

When you filled your database using the artisan command above, you are ready to query the data for your needs by using the Holiday model:

use Honortaker\LaravelHolidaysDe\Models\Holiday;

$holidays = Holiday::all();

Configuration

The package delivers a builtin configuration file which can also be published to overwrite values:

php artisan vendor:publish --tag="holiday-config"

Configuration: holidays-de.holidays_table_name

To prevent collisions with your application tables, you can decide how the table storing the holiday information should be named.

By default, it is named holidays.

Configuration: holidays-de.api_url

The url of the API is also configurable. This config should not be changed because the package expects the response data to be in a specific scheme. However, if the API will move to another domain or change the url in another way, the sourcecode does not need to be touched.

By default, it is set to https://get.api-feiertage.de.

统计信息

  • 总下载量: 4
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-01-25