承接 aa-engineering/laravel-workday-manager 相关项目开发

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

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

aa-engineering/laravel-workday-manager

最新稳定版本:1.1.0

Composer 安装命令:

composer require aa-engineering/laravel-workday-manager

包简介

A Laravel package for managing workday modifications - holidays moved to workdays and vice versa

README 文档

README

A Laravel package for managing workday modifications - holidays moved to workdays and vice versa.

Features

  • Track days when weekends/holidays become working days
  • Track days when working days become holidays
  • Simple API for checking workday status
  • Laravel auto-discovery support
  • Comprehensive test coverage

Installation

Install the package via Composer:

composer require aa-engineering/laravel-workday-manager

Publish and run the migrations:

php artisan vendor:publish --tag="workday-manager-migrations"
php artisan migrate

Optionally, publish the config file:

php artisan vendor:publish --tag="workday-manager-config"

Usage

Creating Moved Workdays

use AAEngineering\WorkdayManager\Models\MovedWorkday;
use Carbon\Carbon;

// A Saturday that becomes a working day
MovedWorkday::create([
    'day' => '2025-12-14',
    'type' => 'workday',
]);

// A Monday that becomes a holiday
MovedWorkday::create([
    'day' => '2025-12-24',
    'type' => 'holiday',
]);

Checking Workday Status

use AAEngineering\WorkdayManager\WorkdayManager;
use Carbon\Carbon;

$date = Carbon::parse('2025-12-14');

// Check if a date has been changed to a holiday
if (WorkdayManager::isChangedToHoliday($date)) {
    // This working day is now a holiday
}

// Check if a date has been changed to a workday
if (WorkdayManager::isChangedToWorkday($date)) {
    // This weekend/holiday is now a working day
}

// Get the modification type (null, 'holiday', or 'workday')
$type = WorkdayManager::getModificationType($date);

Using the Factory

use AAEngineering\WorkdayManager\Models\MovedWorkday;

// Create a random moved workday
$movedWorkday = MovedWorkday::factory()->create();

// Create a weekend moved to workday
$workday = MovedWorkday::factory()->workday()->create();

// Create a workday moved to holiday
$holiday = MovedWorkday::factory()->holiday()->create();

Configuration

The package configuration file config/workday-manager.php allows you to customize:

  • load_migrations: Whether to automatically load package migrations (default: true)

Testing

Run the package tests:

composer test

Laravel Compatibility

  • Laravel 11.x
  • Laravel 12.x

PHP Compatibility

  • PHP 8.2
  • PHP 8.3
  • PHP 8.4

License

The MIT License (MIT). Please see License File for more information.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-10-12

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固