- How do I install this tile in my Laravel project?
- Run `composer require spatie/laravel-dashboard-time-weather-tile`, then register the tile in your `DashboardServiceProvider` using `Dashboard::tile(TimeWeatherTile::class)`. Ensure you have `spatie/laravel-dashboard` (v3.x+) installed first.
- Which Laravel versions are supported?
- This package requires Laravel 8+ and is fully compatible with Laravel 9/10. Always pin to a stable minor version (e.g., `^4.0`) to avoid Dashboard breaking changes.
- Can I use a weather API other than OpenWeatherMap?
- Yes. The package supports custom weather providers via the `weather_provider` config key. You’ll need to implement the `WeatherProvider` interface and update the config accordingly.
- How do I configure the weather unit (Celsius/Fahrenheit)?
- Set the `units` key in the config file (`config/dashboard-time-weather-tile.php`) to either `metric` (Celsius) or `imperial` (Fahrenheit). Defaults to `metric`.
- Will this tile slow down my dashboard load time?
- No, the tile is designed to be lightweight. For optimal performance, enable caching (e.g., Redis) via `Cache::remember()` in your weather provider implementation.
- How do I handle weather API failures gracefully?
- The package includes a fallback mechanism. Configure `show_fallback_on_failure` in the config to display cached data or a placeholder (e.g., static emoji) when the API fails.
- Can I customize the tile’s appearance beyond Tailwind CSS?
- Yes. Override the Blade template by publishing the view (`php artisan vendor:publish --tag=time-weather-tile-views`) and modify the `time-weather-tile` file in `resources/views/vendor/`.
- Does this tile support multiple time zones for different users?
- By default, it uses Laravel’s `app.timezone`. For user-specific time zones, extend the tile’s logic to fetch the user’s timezone from the session or database and pass it to the tile.
- Are there any alternatives to this package?
- For Laravel Dashboards, alternatives include building a custom tile from scratch or using third-party packages like `spatie/laravel-weather` (for standalone weather data). However, this package is the most integrated solution for Spatie Dashboard.
- How do I test this tile in a CI/CD pipeline?
- Run `composer test` to execute the package’s PHPUnit tests. Mock the weather API responses in your test environment to avoid hitting rate limits or costs during testing.