Add acars map page and show in-progress flights
This commit is contained in:
37
app/Http/Controllers/Frontend/AcarsController.php
Normal file
37
app/Http/Controllers/Frontend/AcarsController.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Frontend;
|
||||
|
||||
use App\Models\Pirep;
|
||||
use App\Repositories\AcarsRepository;
|
||||
use App\Services\GeoService;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
class AcarsController extends Controller
|
||||
{
|
||||
private $acarsRepo, $geoSvc;
|
||||
|
||||
public function __construct(
|
||||
AcarsRepository $acarsRepo,
|
||||
GeoService $geoSvc
|
||||
) {
|
||||
$this->acarsRepo = $acarsRepo;
|
||||
$this->geoSvc = $geoSvc;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function index(Request $request)
|
||||
{
|
||||
$pireps = $this->acarsRepo->getPositions();
|
||||
$positions = $this->geoSvc->getFeatureForLiveFlights($pireps);
|
||||
|
||||
return $this->view('acars.index',[
|
||||
'pireps' => $pireps,
|
||||
'positions' => $positions,
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user