Sattelite photo

This commit is contained in:
2020-11-15 05:56:17 +05:00
parent 34e09686ce
commit dc57d8c7c5
2 changed files with 27 additions and 7 deletions

View File

@@ -4,31 +4,43 @@ namespace App\Http\Controllers;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Jinas\Moosun\MoosunMv; use Jinas\Moosun\MoosunMv;
use Jinas\Moosun\ImgScraper;
use Illuminate\Support\Facades\Cache; use Illuminate\Support\Facades\Cache;
class WeatherController extends Controller class WeatherController extends Controller
{ {
protected $stations = [ protected $stations = [
'Male', 'Male',
'Hanimadhoo', 'Hanimadhoo',
'Kahdhoo', 'Kahdhoo',
'Kaadehdhoo', 'Kaadehdhoo',
'Gan']; 'Gan'
];
public function index() public function index()
{ {
return view('weather.index', [ return view('weather.index', [
'stations' => $this->getMoosun(), 'stations' => $this->getMoosun(),
'labels' => [ 'labels' => [
'Male' => "މާލެ", 'Male' => "މާލެ",
'Hanimadhoo' => "ހަނިމާދޫ", 'Hanimadhoo' => "ހަނިމާދޫ",
'Kahdhoo' => "ކައްދޫ", 'Kahdhoo' => "ކައްދޫ",
'Kaadehdhoo' => "ކާޑެއްދޫ", 'Kaadehdhoo' => "ކާޑެއްދޫ",
'Gan' => "ގަން" 'Gan' => "ގަން"
] ],
'satellite_image' => $this->getSatelliteImage()
]); ]);
} }
protected function getSatelliteImage()
{
return Cache::remember('weather.maldives.satellite', 3600, function () {
$image = new ImgScraper;
return $image->satellite_image;
});
}
protected function getMoosun() protected function getMoosun()
{ {

View File

@@ -43,6 +43,14 @@
</div> </div>
<h1 class="text-gray-800 text-2xl text-center mt-5 mb-2 mr-3 MvAamu"
style="font-weight: 100; letter-spacing: 2.5px;">
އެންމެ ފަހުގެ ސެޓެލައިޓް ފޮޓޯ
</h1>
<div class="flex justify-center mb-5">
<img class="w-1/2 h-1/2 object-cover bg-gray-300 rounded" src="{{$satellite_image}}">
</div>
<div class="mb-5 flex justify-center"> <div class="mb-5 flex justify-center">
<p class="text-gray-600">Via Maldives Meteorology</p> <p class="text-gray-600">Via Maldives Meteorology</p>
</div> </div>