Laravel Weather . के साथ मौसम डेटा प्राप्त करें
️ ओपन वेदर मैप एपीआई (वर्तमान मौसम) के आसपास एक आवरण
इंस्टालेशन
आप संगीतकार के माध्यम से पैकेज स्थापित कर सकते हैं:
source-shell composer require gnahotelsolutions/laravel-weather
प्रयोग
text-html-php $weather = new Weather(); // Checking weather by city name $currentWeatherInGirona = $weather->get('girona,es'); // You can use the city id, this will get you unambiguous results $currentWeatherInGirona = $weather->find('3121456');
इकाइयों
डिफ़ॉल्ट रूप से पैकेज |_+_| . का उपयोग करता है सेल्सियस तापमान परिणामों के लिए, इसे कॉन्फ़िगरेशन फ़ाइल का उपयोग करके या मक्खी पर संशोधित किया जा सकता है:
metric
भाषा
डिफ़ॉल्ट रूप से पैकेज |_+_| . का उपयोग करता है विवरण अनुवाद के लिए, इसे कॉन्फ़िगरेशन फ़ाइल का उपयोग करके या मक्खी पर संशोधित किया जा सकता है:
text-html-php $weather = new Weather(); $currentWeatherInGirona = $weather->inUnits('imperial')->get('girona,es');
गज़ल क्लाइंट इंस्टेंस
यदि आपको उदाहरण के लिए शीर्षलेखों को संशोधित करने के लिए Guzzle के किसी अन्य उदाहरण का उपयोग करने की आवश्यकता है:
प्रतिक्रिया-मूल-आसान-ग्रिड
es
परिक्षण
text-html-php $weather = new Weather(); $currentWeatherInGirona = $weather->inLanguage('en')->get('girona');
#लारवेल #PHP #WebDev #php #laravel