Airport lookup from vaCentral API; changes to Airports tables
This commit is contained in:
17
.gitignore
vendored
17
.gitignore
vendored
@@ -30,8 +30,6 @@ tmp/
|
|||||||
.idea/**/workspace.xml
|
.idea/**/workspace.xml
|
||||||
.idea/**/tasks.xml
|
.idea/**/tasks.xml
|
||||||
.idea/dictionaries
|
.idea/dictionaries
|
||||||
|
|
||||||
# Sensitive or high-churn files:
|
|
||||||
.idea/**/dataSources/
|
.idea/**/dataSources/
|
||||||
.idea/**/dataSources.ids
|
.idea/**/dataSources.ids
|
||||||
.idea/**/dataSources.xml
|
.idea/**/dataSources.xml
|
||||||
@@ -39,12 +37,23 @@ tmp/
|
|||||||
.idea/**/sqlDataSources.xml
|
.idea/**/sqlDataSources.xml
|
||||||
.idea/**/dynamic.xml
|
.idea/**/dynamic.xml
|
||||||
.idea/**/uiDesigner.xml
|
.idea/**/uiDesigner.xml
|
||||||
|
.idea/**/gradle.xml
|
||||||
|
.idea/**/libraries
|
||||||
|
cmake-build-debug/
|
||||||
|
.idea/**/mongoSettings.xml
|
||||||
|
*.iws
|
||||||
|
out/
|
||||||
|
.idea_modules/
|
||||||
|
atlassian-ide-plugin.xml
|
||||||
|
.idea/replstate.xml
|
||||||
|
com_crashlytics_export_strings.xml
|
||||||
|
crashlytics.properties
|
||||||
|
crashlytics-build.properties
|
||||||
|
fabric.properties
|
||||||
|
|
||||||
phpvms_next.iml
|
phpvms_next.iml
|
||||||
|
|
||||||
# Gradle:
|
# Gradle:
|
||||||
.idea/**/gradle.xml
|
|
||||||
.idea/**/libraries
|
|
||||||
public/info.php
|
public/info.php
|
||||||
|
|
||||||
local.conf.php
|
local.conf.php
|
||||||
|
|||||||
18
Makefile
18
Makefile
@@ -10,13 +10,13 @@ all: install
|
|||||||
|
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
clean:
|
clean:
|
||||||
@find bootstrap/cache -type f -not -name '.gitignore' -print0 | xargs -0 -r rm --
|
@find bootstrap/cache -type f -not -name '.gitignore' -print0 -delete
|
||||||
@find storage/app/public -type f -not -name '.gitignore' -print0 | xargs -0 -r rm --
|
@find storage/app/public -type f -not -name '.gitignore' -print0 -delete
|
||||||
@find storage/app -type f -not -name '.gitignore' -not -name public -print0 | xargs -0 -r rm --
|
@find storage/app -type f -not -name '.gitignore' -not -name public -print0 -delete
|
||||||
@find storage/framework/cache -type f -not -name '.gitignore' -print0 | xargs -0 -r rm --
|
@find storage/framework/cache -type f -not -name '.gitignore' -print0 -delete
|
||||||
@find storage/framework/sessions -type f -not -name '.gitignore' -print0 | xargs -0 -r rm --
|
@find storage/framework/sessions -type f -not -name '.gitignore' -print0 -delete
|
||||||
@find storage/framework/views -type f -not -name '.gitignore' -print0 | xargs -0 -r rm --
|
@find storage/framework/views -type f -not -name '.gitignore' -print0 -delete
|
||||||
@find storage/logs -type f -not -name '.gitignore' -print0 | xargs -0 -r rm --
|
@find storage/logs -type f -not -name '.gitignore' -print0 -delete
|
||||||
@php artisan route:clear
|
@php artisan route:clear
|
||||||
@php artisan config:clear
|
@php artisan config:clear
|
||||||
|
|
||||||
@@ -32,7 +32,7 @@ install: build
|
|||||||
@echo "Done!"
|
@echo "Done!"
|
||||||
|
|
||||||
.PHONY: update
|
.PHONY: update
|
||||||
update: clean build
|
update: build
|
||||||
@php artisan migrate
|
@php artisan migrate
|
||||||
@echo "Done!"
|
@echo "Done!"
|
||||||
|
|
||||||
@@ -40,7 +40,7 @@ update: clean build
|
|||||||
reset: clean
|
reset: clean
|
||||||
@php artisan database:create --reset
|
@php artisan database:create --reset
|
||||||
@php artisan migrate:refresh --seed
|
@php artisan migrate:refresh --seed
|
||||||
@make install
|
@make update
|
||||||
|
|
||||||
.PHONY: tests
|
.PHONY: tests
|
||||||
tests: test
|
tests: test
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ class AirportController extends BaseController
|
|||||||
*
|
*
|
||||||
* @param Request $request
|
* @param Request $request
|
||||||
* @return Response
|
* @return Response
|
||||||
|
* @throws \Prettus\Repository\Exceptions\RepositoryException
|
||||||
*/
|
*/
|
||||||
public function index(Request $request)
|
public function index(Request $request)
|
||||||
{
|
{
|
||||||
@@ -46,13 +47,16 @@ class AirportController extends BaseController
|
|||||||
*/
|
*/
|
||||||
public function create()
|
public function create()
|
||||||
{
|
{
|
||||||
return view('admin.airports.create');
|
return view('admin.airports.create', [
|
||||||
|
'timezones' => Timezonelist::toArray(),
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Store a newly created Airport in storage.
|
* Store a newly created Airport in storage.
|
||||||
* @param CreateAirportRequest $request
|
* @param CreateAirportRequest $request
|
||||||
* @return Response
|
* @return Response
|
||||||
|
* @throws \Prettus\Validator\Exceptions\ValidatorException
|
||||||
*/
|
*/
|
||||||
public function store(CreateAirportRequest $request)
|
public function store(CreateAirportRequest $request)
|
||||||
{
|
{
|
||||||
@@ -104,9 +108,10 @@ class AirportController extends BaseController
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Update the specified Airport in storage.
|
* Update the specified Airport in storage.
|
||||||
* @param int $id
|
* @param int $id
|
||||||
* @param UpdateAirportRequest $request
|
* @param UpdateAirportRequest $request
|
||||||
* @return Response
|
* @return Response
|
||||||
|
* @throws \Prettus\Validator\Exceptions\ValidatorException
|
||||||
*/
|
*/
|
||||||
public function update($id, UpdateAirportRequest $request)
|
public function update($id, UpdateAirportRequest $request)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ class DashboardController extends BaseController
|
|||||||
/*Feed::$cacheDir = storage_path('app');
|
/*Feed::$cacheDir = storage_path('app');
|
||||||
Feed::$cacheExpire = '5 hours';
|
Feed::$cacheExpire = '5 hours';
|
||||||
|
|
||||||
$feed = Feed::loadRss(config('phpvms.feed_url'));*/
|
$feed = Feed::loadRss(config('phpvms.news_feed_url'));*/
|
||||||
$feed = [];
|
$feed = [];
|
||||||
return view('admin.dashboard.index', [
|
return view('admin.dashboard.index', [
|
||||||
'feed' => $feed,
|
'feed' => $feed,
|
||||||
|
|||||||
31
app/Http/Controllers/Api/AirportController.php
Normal file
31
app/Http/Controllers/Api/AirportController.php
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Api;
|
||||||
|
|
||||||
|
use App\Repositories\AirportRepository;
|
||||||
|
use App\Http\Controllers\AppBaseController;
|
||||||
|
use App\Http\Resources\Airport as AirportResource;
|
||||||
|
|
||||||
|
use VaCentral\Airport as AirportLookup;
|
||||||
|
|
||||||
|
class AirportController extends AppBaseController
|
||||||
|
{
|
||||||
|
protected $airportRepo;
|
||||||
|
|
||||||
|
public function __construct(
|
||||||
|
AirportRepository $airportRepo
|
||||||
|
) {
|
||||||
|
$this->airportRepo = $airportRepo;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Do a lookup, via vaCentral, for the airport information
|
||||||
|
* @param $id
|
||||||
|
* @return AirportResource
|
||||||
|
*/
|
||||||
|
public function lookup($id)
|
||||||
|
{
|
||||||
|
$airport = AirportLookup::get($id);
|
||||||
|
return new AirportResource(collect($airport));
|
||||||
|
}
|
||||||
|
}
|
||||||
19
app/Http/Resources/Airport.php
Normal file
19
app/Http/Resources/Airport.php
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Resources;
|
||||||
|
|
||||||
|
use Illuminate\Http\Resources\Json\Resource;
|
||||||
|
|
||||||
|
class Airport extends Resource
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Transform the resource into an array.
|
||||||
|
*
|
||||||
|
* @param \Illuminate\Http\Request $request
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function toArray($request)
|
||||||
|
{
|
||||||
|
return parent::toArray($request);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -15,9 +15,14 @@ class AppServiceProvider extends ServiceProvider
|
|||||||
{
|
{
|
||||||
Schema::defaultStringLength(191);
|
Schema::defaultStringLength(191);
|
||||||
|
|
||||||
|
//\VaCentral\VaCentral::setVaCentralUrl(config('phpvms.vacentral_api_url'));
|
||||||
|
if(!empty(config('phpvms.vacentral_api_key'))) {
|
||||||
|
\VaCentral\VaCentral::setApiKey(config('phpvms.vacentral_api_key'));
|
||||||
|
}
|
||||||
|
|
||||||
# if there's a local.conf.php in the root, then merge that in
|
# if there's a local.conf.php in the root, then merge that in
|
||||||
if(file_exists(base_path('local.conf.php'))) {
|
if(file_exists(base_path('local.conf.php'))) {
|
||||||
$local_conf = include(base_path('local.conf.php'));
|
$local_conf = include base_path('local.conf.php');
|
||||||
$config = $this->app['config']->get('phpvms', []);
|
$config = $this->app['config']->get('phpvms', []);
|
||||||
$this->app['config']->set(
|
$this->app['config']->set(
|
||||||
'phpvms',
|
'phpvms',
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
"keywords": ["phpvms", "virtual", "airlines"],
|
"keywords": ["phpvms", "virtual", "airlines"],
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"type": "project",
|
"type": "project",
|
||||||
"minimum-stability": "stable",
|
"prefer-stable": true,
|
||||||
"url": "https://github.com/nabeelio/phpvms.git",
|
"url": "https://github.com/nabeelio/phpvms.git",
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=7.0",
|
"php": ">=7.0",
|
||||||
@@ -45,11 +45,12 @@
|
|||||||
"scriptfusion/phpunit-immediate-exception-printer": "1.3.0",
|
"scriptfusion/phpunit-immediate-exception-printer": "1.3.0",
|
||||||
"nwidart/laravel-modules": "2.6.0",
|
"nwidart/laravel-modules": "2.6.0",
|
||||||
"sebastiaanluca/laravel-helpers": "1.0.2",
|
"sebastiaanluca/laravel-helpers": "1.0.2",
|
||||||
"nabeel/laravel-installer": "dev-master",
|
|
||||||
"tivie/php-os-detector": "1.1.0",
|
"tivie/php-os-detector": "1.1.0",
|
||||||
"jackiedo/timezonelist": "^5.0",
|
"jackiedo/timezonelist": "^5.0",
|
||||||
"nesbot/carbon": "^1.22",
|
"nesbot/carbon": "^1.22",
|
||||||
"tremby/laravel-git-version": "^1.1"
|
"tremby/laravel-git-version": "^1.1",
|
||||||
|
"nabeel/laravel-installer": "dev-master",
|
||||||
|
"nabeel/vacentral": "dev-master"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"phpunit/phpunit": "6.4.0",
|
"phpunit/phpunit": "6.4.0",
|
||||||
|
|||||||
224
composer.lock
generated
224
composer.lock
generated
@@ -4,7 +4,7 @@
|
|||||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
|
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
|
||||||
"This file is @generated automatically"
|
"This file is @generated automatically"
|
||||||
],
|
],
|
||||||
"content-hash": "2f361a73a9d21108cf1e05a2bbfb1626",
|
"content-hash": "459233f5328b1d32bc905cdf05d8b523",
|
||||||
"packages": [
|
"packages": [
|
||||||
{
|
{
|
||||||
"name": "anlutro/l4-settings",
|
"name": "anlutro/l4-settings",
|
||||||
@@ -985,6 +985,187 @@
|
|||||||
],
|
],
|
||||||
"time": "2017-11-14T20:44:03+00:00"
|
"time": "2017-11-14T20:44:03+00:00"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "guzzlehttp/guzzle",
|
||||||
|
"version": "6.3.0",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/guzzle/guzzle.git",
|
||||||
|
"reference": "f4db5a78a5ea468d4831de7f0bf9d9415e348699"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/guzzle/guzzle/zipball/f4db5a78a5ea468d4831de7f0bf9d9415e348699",
|
||||||
|
"reference": "f4db5a78a5ea468d4831de7f0bf9d9415e348699",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"guzzlehttp/promises": "^1.0",
|
||||||
|
"guzzlehttp/psr7": "^1.4",
|
||||||
|
"php": ">=5.5"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"ext-curl": "*",
|
||||||
|
"phpunit/phpunit": "^4.0 || ^5.0",
|
||||||
|
"psr/log": "^1.0"
|
||||||
|
},
|
||||||
|
"suggest": {
|
||||||
|
"psr/log": "Required for using the Log middleware"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"extra": {
|
||||||
|
"branch-alias": {
|
||||||
|
"dev-master": "6.2-dev"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"files": [
|
||||||
|
"src/functions_include.php"
|
||||||
|
],
|
||||||
|
"psr-4": {
|
||||||
|
"GuzzleHttp\\": "src/"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Michael Dowling",
|
||||||
|
"email": "mtdowling@gmail.com",
|
||||||
|
"homepage": "https://github.com/mtdowling"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Guzzle is a PHP HTTP client library",
|
||||||
|
"homepage": "http://guzzlephp.org/",
|
||||||
|
"keywords": [
|
||||||
|
"client",
|
||||||
|
"curl",
|
||||||
|
"framework",
|
||||||
|
"http",
|
||||||
|
"http client",
|
||||||
|
"rest",
|
||||||
|
"web service"
|
||||||
|
],
|
||||||
|
"time": "2017-06-22T18:50:49+00:00"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "guzzlehttp/promises",
|
||||||
|
"version": "v1.3.1",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/guzzle/promises.git",
|
||||||
|
"reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/guzzle/promises/zipball/a59da6cf61d80060647ff4d3eb2c03a2bc694646",
|
||||||
|
"reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"php": ">=5.5.0"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"phpunit/phpunit": "^4.0"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"extra": {
|
||||||
|
"branch-alias": {
|
||||||
|
"dev-master": "1.4-dev"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"GuzzleHttp\\Promise\\": "src/"
|
||||||
|
},
|
||||||
|
"files": [
|
||||||
|
"src/functions_include.php"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Michael Dowling",
|
||||||
|
"email": "mtdowling@gmail.com",
|
||||||
|
"homepage": "https://github.com/mtdowling"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Guzzle promises library",
|
||||||
|
"keywords": [
|
||||||
|
"promise"
|
||||||
|
],
|
||||||
|
"time": "2016-12-20T10:07:11+00:00"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "guzzlehttp/psr7",
|
||||||
|
"version": "1.4.2",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/guzzle/psr7.git",
|
||||||
|
"reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/guzzle/psr7/zipball/f5b8a8512e2b58b0071a7280e39f14f72e05d87c",
|
||||||
|
"reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"php": ">=5.4.0",
|
||||||
|
"psr/http-message": "~1.0"
|
||||||
|
},
|
||||||
|
"provide": {
|
||||||
|
"psr/http-message-implementation": "1.0"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"phpunit/phpunit": "~4.0"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"extra": {
|
||||||
|
"branch-alias": {
|
||||||
|
"dev-master": "1.4-dev"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"GuzzleHttp\\Psr7\\": "src/"
|
||||||
|
},
|
||||||
|
"files": [
|
||||||
|
"src/functions_include.php"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Michael Dowling",
|
||||||
|
"email": "mtdowling@gmail.com",
|
||||||
|
"homepage": "https://github.com/mtdowling"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Tobias Schultze",
|
||||||
|
"homepage": "https://github.com/Tobion"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "PSR-7 message implementation that also provides common utility methods",
|
||||||
|
"keywords": [
|
||||||
|
"http",
|
||||||
|
"message",
|
||||||
|
"request",
|
||||||
|
"response",
|
||||||
|
"stream",
|
||||||
|
"uri",
|
||||||
|
"url"
|
||||||
|
],
|
||||||
|
"time": "2017-03-20T17:10:46+00:00"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "hashids/hashids",
|
"name": "hashids/hashids",
|
||||||
"version": "2.0.4",
|
"version": "2.0.4",
|
||||||
@@ -2126,6 +2307,42 @@
|
|||||||
"description": "Laravel web installer",
|
"description": "Laravel web installer",
|
||||||
"time": "2017-12-04T19:05:57+00:00"
|
"time": "2017-12-04T19:05:57+00:00"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "nabeel/vacentral",
|
||||||
|
"version": "dev-master",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/nabeelio/vacentral-library.git",
|
||||||
|
"reference": "79093ce128b791755a787a420d344b8adb05e8a4"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/nabeelio/vacentral-library/zipball/79093ce128b791755a787a420d344b8adb05e8a4",
|
||||||
|
"reference": "79093ce128b791755a787a420d344b8adb05e8a4",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"guzzlehttp/guzzle": "6.3.0",
|
||||||
|
"php": ">= 7.0.0",
|
||||||
|
"symfony/lts": "v3"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"doctrine/instantiator": "v1.0.5",
|
||||||
|
"phpunit/phpunit": "5.7.25",
|
||||||
|
"phpunit/phpunit-mock-objects": "3.4.4"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"VaCentral\\": "src/"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"time": "2017-12-07T20:57:37+00:00"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "nesbot/carbon",
|
"name": "nesbot/carbon",
|
||||||
"version": "1.22.1",
|
"version": "1.22.1",
|
||||||
@@ -7172,9 +7389,10 @@
|
|||||||
"infyomlabs/adminlte-templates": 20,
|
"infyomlabs/adminlte-templates": 20,
|
||||||
"zizaco/entrust": 20,
|
"zizaco/entrust": 20,
|
||||||
"makinacorpus/php-bloom": 20,
|
"makinacorpus/php-bloom": 20,
|
||||||
"nabeel/laravel-installer": 20
|
"nabeel/laravel-installer": 20,
|
||||||
|
"nabeel/vacentral": 20
|
||||||
},
|
},
|
||||||
"prefer-stable": false,
|
"prefer-stable": true,
|
||||||
"prefer-lowest": false,
|
"prefer-lowest": false,
|
||||||
"platform": {
|
"platform": {
|
||||||
"php": ">=7.0"
|
"php": ">=7.0"
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ return [
|
|||||||
SebastiaanLuca\Helpers\Methods\GlobalHelpersServiceProvider::class,
|
SebastiaanLuca\Helpers\Methods\GlobalHelpersServiceProvider::class,
|
||||||
SebastiaanLuca\Helpers\Collections\CollectionMacrosServiceProvider::class,
|
SebastiaanLuca\Helpers\Collections\CollectionMacrosServiceProvider::class,
|
||||||
Toin0u\Geotools\GeotoolsServiceProvider::class,
|
Toin0u\Geotools\GeotoolsServiceProvider::class,
|
||||||
//Jackiedo\Timezonelist\TimezonelistServiceProvider::class,
|
Jackiedo\Timezonelist\TimezonelistServiceProvider::class,
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Application Service Providers...
|
* Application Service Providers...
|
||||||
|
|||||||
@@ -35,8 +35,18 @@ return [
|
|||||||
*/
|
*/
|
||||||
'only_flights_from_current' => false,
|
'only_flights_from_current' => false,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Your vaCentral API key
|
||||||
|
*/
|
||||||
|
'vacentral_api_key' => '',
|
||||||
|
|
||||||
|
/**
|
||||||
|
* vaCentral API URL. You likely don't need to change this
|
||||||
|
*/
|
||||||
|
'vacentral_api_url' => 'https://api.vacentral.net',
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Misc Settings
|
* Misc Settings
|
||||||
*/
|
*/
|
||||||
'feed_url' => 'http://forum.phpvms.net/rss/1-announcements-feed.xml/?',
|
'news_feed_url' => 'http://forum.phpvms.net/rss/1-announcements-feed.xml/?',
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ class CreateAirportsTable extends Migration
|
|||||||
$table->string('name', 100);
|
$table->string('name', 100);
|
||||||
$table->string('location', 100)->nullable();
|
$table->string('location', 100)->nullable();
|
||||||
$table->string('country', 48)->nullable();
|
$table->string('country', 48)->nullable();
|
||||||
$table->string('timezone', 64)->nullable();
|
$table->string('tz', 64)->nullable();
|
||||||
$table->double('fuel_100ll_cost', 19, 2)->default(0);
|
$table->double('fuel_100ll_cost', 19, 2)->default(0);
|
||||||
$table->double('fuel_jeta_cost', 19, 2)->default(0);
|
$table->double('fuel_jeta_cost', 19, 2)->default(0);
|
||||||
$table->double('fuel_mogas_cost', 19, 2)->default(0);
|
$table->double('fuel_mogas_cost', 19, 2)->default(0);
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ airports:
|
|||||||
location: Austin, Texas, USA
|
location: Austin, Texas, USA
|
||||||
lat: 30.1945278
|
lat: 30.1945278
|
||||||
lon: -97.6698889
|
lon: -97.6698889
|
||||||
timezone: America/Chicago
|
tz: America/Chicago
|
||||||
- id: KJFK
|
- id: KJFK
|
||||||
iata: JFK
|
iata: JFK
|
||||||
icao: KJFK
|
icao: KJFK
|
||||||
@@ -103,7 +103,7 @@ airports:
|
|||||||
location: New York, New York, USA
|
location: New York, New York, USA
|
||||||
lat: 40.6399257
|
lat: 40.6399257
|
||||||
lon: -73.7786950
|
lon: -73.7786950
|
||||||
timezone: America/New_York
|
tz: America/New_York
|
||||||
- id: EGLL
|
- id: EGLL
|
||||||
iata: LHR
|
iata: LHR
|
||||||
icao: EGLL
|
icao: EGLL
|
||||||
@@ -111,7 +111,7 @@ airports:
|
|||||||
location: London, England
|
location: London, England
|
||||||
lat: 51.4775
|
lat: 51.4775
|
||||||
lon: -0.4614
|
lon: -0.4614
|
||||||
timezone: Europe/London
|
tz: Europe/London
|
||||||
|
|
||||||
#
|
#
|
||||||
aircraft:
|
aircraft:
|
||||||
|
|||||||
@@ -2,7 +2,18 @@
|
|||||||
* admin functions, mostly map/mapping related
|
* admin functions, mostly map/mapping related
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function phpvms_render_airspace_map(opts) {
|
function phpvms_vacentral_airport_lookup(icao, callback)
|
||||||
|
{
|
||||||
|
$.ajax({
|
||||||
|
url: '/api/airports/' + icao + '/lookup',
|
||||||
|
method: 'GET'
|
||||||
|
}).done(function (data, status) {
|
||||||
|
callback(data.data);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function phpvms_render_airspace_map(opts)
|
||||||
|
{
|
||||||
opts = __parse_opts(opts);
|
opts = __parse_opts(opts);
|
||||||
var map = __draw_base_map(opts);
|
var map = __draw_base_map(opts);
|
||||||
if(opts.set_marker == true) { L.marker(coords).addTo(map); }
|
if(opts.set_marker == true) { L.marker(coords).addTo(map); }
|
||||||
|
|||||||
@@ -1,12 +1,13 @@
|
|||||||
@extends('admin.app')
|
@extends('admin.app')
|
||||||
@section('title', "Add Airport")
|
@section('title', 'Add Airport')
|
||||||
@section('content')
|
@section('content')
|
||||||
<div class="card border-blue-bottom">
|
<div class="card border-blue-bottom">
|
||||||
<div class="content">
|
<div class="content">
|
||||||
@include('adminlte-templates::common.errors')
|
@include('adminlte-templates::common.errors')
|
||||||
{!! Form::open(['route' => 'admin.airports.store']) !!}
|
{!! Form::open(['route' => 'admin.airports.store', 'id' => 'airportForm']) !!}
|
||||||
@include('admin.airports.fields')
|
@include('admin.airports.fields')
|
||||||
{!! Form::close() !!}
|
{!! Form::close() !!}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@endsection
|
@endsection
|
||||||
|
@include('admin.airports.script')
|
||||||
|
|||||||
@@ -4,9 +4,10 @@
|
|||||||
<div class="card border-blue-bottom">
|
<div class="card border-blue-bottom">
|
||||||
<div class="content">
|
<div class="content">
|
||||||
@include('adminlte-templates::common.errors')
|
@include('adminlte-templates::common.errors')
|
||||||
{!! Form::model($airport, ['route' => ['admin.airports.update', $airport->id], 'method' => 'patch']) !!}
|
{!! Form::model($airport, ['route' => ['admin.airports.update', $airport->id], 'method' => 'patch', 'id' => 'airportForm']) !!}
|
||||||
@include('admin.airports.fields')
|
@include('admin.airports.fields')
|
||||||
{!! Form::close() !!}
|
{!! Form::close() !!}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@endsection
|
@endsection
|
||||||
|
@include('admin.airports.script')
|
||||||
|
|||||||
@@ -1,40 +1,66 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<!-- Icao Field -->
|
<div class="col-lg-12">
|
||||||
<div class="form-group col-sm-6">
|
<!-- Icao Field -->
|
||||||
{!! Form::label('icao', 'ICAO:') !!}
|
<div class="row">
|
||||||
{!! Form::text('icao', null, ['class' => 'form-control']) !!}
|
<div class="form-group col-sm-6">
|
||||||
</div>
|
{!! Form::label('icao', 'ICAO:') !!}
|
||||||
|
<a href="#" class="airport_data_lookup">Lookup</a>
|
||||||
|
{!! Form::text('icao', null, [
|
||||||
|
'id' => 'airport_icao', 'class' => 'form-control',
|
||||||
|
'rv-value' => 'airport.icao'
|
||||||
|
]) !!}
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="form-group col-sm-6">
|
<div class="form-group col-sm-6">
|
||||||
{!! Form::label('name', 'Name:') !!}
|
{!! Form::label('iata', 'IATA:') !!}
|
||||||
{!! Form::text('name', null, ['class' => 'form-control']) !!}
|
{!! Form::text('iata', null, ['class' => 'form-control', 'rv-value' => 'airport.iata']) !!}
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="form-group col-sm-6">
|
<div class="row">
|
||||||
{!! Form::label('location', 'Location:') !!}
|
<div class="form-group col-sm-6">
|
||||||
{!! Form::text('location', null, ['class' => 'form-control']) !!}
|
{!! Form::label('name', 'Name:') !!}
|
||||||
</div>
|
{!! Form::text('name', null, ['class' => 'form-control', 'rv-value' => 'airport.name']) !!}
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="form-group col-sm-6">
|
<div class="form-group col-sm-6">
|
||||||
{!! Form::label('lat', 'Latitude:') !!}
|
{!! Form::label('location', 'Location:') !!}
|
||||||
{!! Form::number('lat', null, ['class' => 'form-control', 'step' => '0.000001']) !!}
|
{!! Form::text('location', null, ['class' => 'form-control', 'rv-value' => 'airport.city']) !!}
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="form-group col-sm-6">
|
<div class="row">
|
||||||
{!! Form::label('lon', 'Longitude:') !!}
|
<div class="form-group col-sm-6">
|
||||||
{!! Form::number('lon', null, ['class' => 'form-control', 'step' => '0.000001']) !!}
|
{!! Form::label('country', 'Country:') !!}
|
||||||
</div>
|
{!! Form::text('country', null, ['class' => 'form-control', 'rv-value' => 'airport.country']) !!}
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="form-group col-sm-6">
|
<div class="form-group col-sm-6">
|
||||||
{!! Form::label('timezone', 'Timezone:') !!}
|
{!! Form::label('tz', 'Timezone:') !!}
|
||||||
{!! Form::select('timezone', $timezones, null, ['id' => 'timezone', 'class' => 'select2' ]); !!}
|
{!! Form::select('tz', $timezones, null, ['class' => 'select2']); !!}
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- Submit Field -->
|
<div class="row">
|
||||||
<div class="form-group col-sm-12">
|
<div class="form-group col-sm-6">
|
||||||
<div class="pull-right">
|
{!! Form::label('lat', 'Latitude:') !!}
|
||||||
{!! Form::submit('Save', ['class' => 'btn btn-primary']) !!}
|
{!! Form::number('lat', null, ['class' => 'form-control', 'step' => '0.000001', 'rv-value' => 'airport.lat']) !!}
|
||||||
<a href="{!! route('admin.airports.index') !!}" class="btn btn-default">Cancel</a>
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group col-sm-6">
|
||||||
|
{!! Form::label('lon', 'Longitude:') !!}
|
||||||
|
{!! Form::number('lon', null, ['class' => 'form-control', 'step' => '0.000001', 'rv-value' => 'airport.lon']) !!}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<!-- Submit Field -->
|
||||||
|
<div class="form-group col-sm-12">
|
||||||
|
<div class="pull-right">
|
||||||
|
{!! Form::submit('Save', ['class' => 'btn btn-primary']) !!}
|
||||||
|
<a href="{!! route('admin.airports.index') !!}" class="btn btn-default">Cancel</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
@section('scripts')
|
@section('scripts')
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
|
||||||
$('#airports-table a.inline').editable({
|
$('#airports-table a.inline').editable({
|
||||||
type: 'text',
|
type: 'text',
|
||||||
mode: 'inline',
|
mode: 'inline',
|
||||||
@@ -16,6 +18,29 @@ $(document).ready(function() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('a.airport_data_lookup').click(function(e) {
|
||||||
|
e.preventDefault();
|
||||||
|
var icao = $("input#airport_icao").val();
|
||||||
|
if(icao === '') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
phpvms_vacentral_airport_lookup(icao, function(data) {
|
||||||
|
console.log('lookup data', data);
|
||||||
|
_.forEach(data, function(value, key) {
|
||||||
|
if(key === 'city') {
|
||||||
|
key = 'location';
|
||||||
|
}
|
||||||
|
|
||||||
|
$("#" + key).val(value);
|
||||||
|
|
||||||
|
if(key === 'tz') {
|
||||||
|
$("#tz").trigger('change');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
@endsection
|
@endsection
|
||||||
|
|||||||
@@ -17,6 +17,8 @@ Route::group([], function () {
|
|||||||
|
|
||||||
Route::match(['get'], 'status', 'BaseController@status');
|
Route::match(['get'], 'status', 'BaseController@status');
|
||||||
|
|
||||||
|
Route::match(['get'], 'airports/{id}/lookup', 'AirportController@lookup');
|
||||||
|
|
||||||
Route::match(['get'], 'flight/{id}', 'FlightController@get');
|
Route::match(['get'], 'flight/{id}', 'FlightController@get');
|
||||||
Route::match(['get'], 'flights/search', 'FlightController@search');
|
Route::match(['get'], 'flights/search', 'FlightController@search');
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user