prasun-packages / weather-info
It provides the latest weather information for any city or geographic location in the world.
Installs: 5
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Language:Blade
Requires
- guzzlehttp/guzzle: ^7.0.1
README
Installation Steps:
- Open your project root folder in a terminal and run the below command to install the package;
composer require prasun-packages/weather-info --with-all-dependencies
- Open the config/app.php file within the project root folder and scroll down to the providers array. In that array, there should be a section for the package service providers. Add the following line of code in that section;
PrasunPackages\WeatherInfo\Providers\WeatherInfoProvider::class,
- To publish the configuration file into Laravel’s config folder within the project root, run the below command;
php artisan vendor:publish
- When you hit the above command in a terminal, you will be provided a list of all service providers registered in your application. Choose the PrasunPackages\WeatherInfo\Providers\WeatherInfoProvider and hit enter.
- We are using API Ninjas 2 in our package. So to run the application you need an API Key which you will get by Sign up below link;
- Login and copy the API Key from the My Account section, add one environment variable within the .env file in your project root folder and paste the same as value;
API_NINJAS_API_KEY=[replace_with_your_api_key]
Run the application:
You are now able to access the weather-info via the below route within your application;
/weather-info