定制 arshaviras/weather-widget 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

arshaviras/weather-widget

Composer 安装命令:

composer require arshaviras/weather-widget

包简介

A weather widget for Filament

README 文档

README

Weather Widget

A beautiful, configurable weather widget for your Filament dashboard.
Powered by the OpenWeatherMap API, fully translatable, and supports °C/°F, animated Weather Icons, and optional response caching.

Features

  • 🌤️ Displays current temperature, condition, hourly forecast and weather icons
  • 🔁 Auto-refresh at a configurable interval
  • ☁️ Supports both metric and imperial units (°C/°F)
  • 🌍 Multi-language support
  • 🧠 Optional caching (prevents exceeding API rate limits)
  • ⚙️ Customizable location by city
  • 🎨 Supports 3 icon styles: Monochrome, Line, and Fill
  • 🔄 Supports static and animated icon variants

Requirements

  • PHP 8.2 or higher
  • Laravel 11.x, 12.x or 13.x
  • Filament 4.x or 5.x

Installation

You can install the package via composer:

composer require arshaviras/weather-widget

Setup

1. Register the Widget

Add the widget to your Filament panel configuration:

use Arshaviras\WeatherWidget\Widgets\WeatherWidget;
use Filament\Panel;

public function panel(Panel $panel): Panel
{
    return $panel
        // ... other configuration
        ->widgets([
                //...
                WeatherWidget::class,
            ])
}

2. Configuration

Publish the config file:

php artisan vendor:publish --tag="weather-widget-config"

This is the contents of the published config file:

return [

    /**
     * API Key for Current Weather Data
     * You can get your API key from OpenWeatherMap:
     * https://openweathermap.org/price
     */
    'api_key' => env('OPENWEATHER_API_KEY', ''),


    /**
     * Default city for weather data
     */
    'city' => 'Yerevan',


    /**
     * Units for temperature and other measurements
     * Options: 'metric', 'imperial'
     * 'metric' - Celsius (°C), 'imperial' - Fahrenheit (°F)
     * Default is 'metric'
     */
    'units' => 'metric',

    
    /**
     * Refresh (Poll) interval in minutes
     * This determines how often the weather data will be refreshed.
     * This also factors into the cache duration.
     */
    'refresh_minutes' => 30, 

    /**
     * Icon settings
     * You can customize the icon set and variant used in the widget.
     * 'icon_set' can be 'fill', 'line', or 'monochrome'.
     */
    'icon_set' => 'fill',

    /**
     * Icon variant
     * Options: 'static', 'animated' (only for fill/line icons)
     */
    'icon_variant' => 'animated',
];

3. Translations (Optional)

If you want to customize the translations, you can publish the translations file:

php artisan vendor:publish --tag="weather-widget-translations"

Usage

Once the widget is registered, a "Weather Widget" will automatically be added to your Filament Dashboard.

Available Icon Sets

  • fill – Filled icons
  • line – Outlined icons
  • monochrome – Black/White icons

🎨 fill – Filled Icons

Light Mode Dark Mode
Fill Light Fill Dark

✏️ line – Outlined Icons

Light Mode Dark Mode
Line Light Line Dark

🌓 monochrome – Black & White Icons

Light Mode Dark Mode
Monochrome Light Monochrome Dark

Available Icon Variants

Static and Animated (only for fill/line icons)

  • static - Static Icons
  • animated - Animated icons

Credits

Meteo Icons by Bas Milius

arshaviras/weather-widget 适用场景与选型建议

arshaviras/weather-widget 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 3.73k 次下载、GitHub Stars 达 4, 最近一次更新时间为 2025 年 11 月 04 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「laravel」 「filament」 「filament-plugin」 「arshaviras」 「weather-widget」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 arshaviras/weather-widget 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 arshaviras/weather-widget 我们能提供哪些服务?
定制开发 / 二次开发

基于 arshaviras/weather-widget 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

  • Stars: 4
  • Watchers: 1
  • Forks: 5
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-11-04