getarabictimepackage/arabic-time 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

getarabictimepackage/arabic-time

最新稳定版本:1.0.3

Composer 安装命令:

composer require getarabictimepackage/arabic-time

包简介

A Laravel package to convert time to Arabic time periods.

README 文档

README

If your package doesn't include a configuration file that users can publish, you can remove that part from the README. Here's the updated version:

Arabic Time Package

Latest Stable Version Total Downloads License

Arabic Time Package is a PHP package that helps you display time in Arabic format. It's designed to be easy to integrate into your Laravel applications, but it can be used in any PHP project.

Features

  • Display time in Arabic language format.
  • Easy integration with Blade templates in Laravel.
  • Supports different time formats and customization.

Installation

You can install the package via Composer:

composer require getarabictimepackage/arabic-time

Usage

Basic Usage

After installing the package, you can use it directly in your PHP code to display the current time in Arabic format:

use GetArabicTimePackage\ArabicTime\ArabicTime;

echo ArabicTime::now(); // Displays the current time in Arabic

Custom Time Formatting

You can also format the time according to your needs:

use GetArabicTimePackage\ArabicTime\ArabicTime;

$time = new DateTime('now');
echo ArabicTime::format($time, 'H:i'); // Displays time in Arabic with a custom format

Blade Directives (Laravel Only)

If you're using Laravel, you can utilize the provided Blade directives for easier integration:

  1. Register the service provider in config/app.php (if not auto-discovered):

  2. Register the service provider in Laravel 11 bootstrap/providers.php

    'providers' => [
        // Other service providers...
        GetArabicTimePackage\ArabicTime\ArabicTimeServiceProvider::class,
    ],
  3. Use the directives in your Blade views:

    @arabicTime($time) // Converts the given DateTime instance to Arabic time

Example in Blade

<!DOCTYPE html>
<html lang="ar">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Arabic Time Example</title>
</head>
<body>
    <h1>الوقت الحالي: @arabicTime(now())</h1>
</body>
</html>

Contributing

Contributions are welcome! Please submit a pull request or open an issue to discuss your ideas.

License

This package is open-sourced software licensed under the MIT license.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-08-26

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固