This is a weather application built with PHP and Laravel. It fetches current weather data from the OpenWeather API and displays it to the user.
- Fetch current weather by city name
- Display weather conditions, temperature, humidity, wind speed, and more
- Convert wind speed from metric to imperial units
- CLI command to fetch and display weather data
- Unit tests for the CLI command
- Forked openweather package to add more features
- PHP 7.4 or higher
- Composer
- OpenWeather API key
-
Clone the repository:
git clone https://github.com/Lintume/landscape_tech_task.git cd landscape_tech_task
-
Install dependencies:
composer install npm install npm run dev
-
Copy the
.env.example
file to.env
and update the environment variables:cp .env.example .env
-
Set your OpenWeather API key in the
.env
file:OPENWEATHER_API_KEY=your_api_key_here
-
Generate an application key:
php artisan key:generate
-
Create database tables (choose yes):
php artisan migrate
-
Run the development server:
php artisan serve
- Open your browser and navigate to
http://localhost:8000
. - Enter a city name to fetch the current weather data.
You can also fetch and display weather data using the CLI command:
php artisan app:weather-search {city}
Replace {city}
with the name of the city you want to fetch the weather data for.
To run the unit tests for the CLI command, use the following command:
php artisan test
Thank you for considering contributing to this project! Please follow the contribution guide.
This project is open-sourced software licensed under the MIT license.