- How do I install the Spatie Laravel Dashboard Time & Weather Tile?
- Run `composer require spatie/laravel-dashboard-time-weather-tile:^4.1.0` after ensuring you have `spatie/laravel-dashboard` installed (v3.x+). The package auto-detects Laravel’s timezone (config/app.timezone) since 4.1.0, so no manual timezone setup is needed.
- Which Laravel and PHP versions are supported?
- This package requires **Laravel 10+** and **PHP 8.1+**. Older versions may work but aren’t officially tested. Always check the [CHANGELOG](https://github.com/spatie/laravel-dashboard-time-weather-tile/blob/main/CHANGELOG.md) for updates.
- Do I need a weather API key, and where do I configure it?
- Yes, you must provide a weather API key (e.g., OpenWeatherMap, WeatherAPI). Store it in your `.env` file as `WEATHER_API_KEY=your_key_here`. The package doesn’t bundle an API—you’re responsible for selecting and managing it.
- Can this tile work with multiple timezones in a single Laravel app?
- Yes, since version 4.1.0, the tile automatically uses Laravel’s configured timezone (`config/app.timezone`). For user-specific timezones (e.g., regional teams), you’d need to extend the tile or use middleware to override the timezone dynamically.
- What happens if the weather API fails or returns rate-limited responses?
- The tile will display the last cached weather data if available. For robust handling, implement **fallback mechanisms** (e.g., static placeholders) or **monitor API failures** via logging/Sentry. Caching responses locally can mitigate rate limits.
- Is this tile compatible with custom Laravel Dashboard themes or CSS?
- The tile uses Tailwind CSS by default but can be customized via **Blade overrides** or **custom CSS/JS**. If your dashboard uses a design system, ensure your styles don’t conflict with the tile’s default classes (e.g., `time-weather-tile`).
- How do I add this tile to my Laravel Dashboard?
- Register the tile in your dashboard’s tile registry using `Dashboard::tile(TimeWeatherTile::class)`. Example: `Dashboard::tile(TimeWeatherTile::class)->width(3)->height(2);` to control its size in the dashboard grid.
- Are there alternatives to this package for Laravel weather/time displays?
- For standalone solutions, consider **Laravel Weather** (e.g., `spatie/laravel-weather`) or custom Blade components with APIs like OpenWeatherMap. However, this tile is optimized for **Spatie’s Dashboard ecosystem**, offering seamless integration with other dashboard tiles.
- Does this package support offline caching for weather data?
- No, the package doesn’t include built-in offline caching. To enable this, extend the tile’s logic to cache API responses (e.g., using Laravel’s cache drivers) or implement a fallback UI when the API is unreachable.
- How do I test this tile for production reliability?
- Test timezone accuracy across regions, simulate API failures (e.g., mock responses), and verify caching behavior. Use Laravel’s `config/testing.php` to override the weather API key for isolated tests. Monitor performance under load if deployed on high-traffic dashboards.