diff --git a/app/Classes/AircraftListExcel.php b/app/Classes/AircraftListExcel.php index 2c2cdc5e..d9dd9f2e 100644 --- a/app/Classes/AircraftListExcel.php +++ b/app/Classes/AircraftListExcel.php @@ -3,12 +3,11 @@ * Created by PhpStorm. * User: taylorbroad * Date: 1/6/17 - * Time: 3:48 AM + * Time: 3:48 AM. */ namespace App\Classes; - class AircraftListExcel extends \Maatwebsite\Excel\Files\ExcelFile { protected $delimiter = ','; @@ -17,10 +16,11 @@ class AircraftListExcel extends \Maatwebsite\Excel\Files\ExcelFile public function getFile() { - return storage_path('Imports'). '/fleet.csv'; + return storage_path('Imports').'/fleet.csv'; } + public function getFilters() { return parent::getFilters(); // TODO: Change the autogenerated stub } -} \ No newline at end of file +} diff --git a/app/Classes/OTF_DB.php b/app/Classes/OTF_DB.php index a2d0d8b0..ce6e1682 100644 --- a/app/Classes/OTF_DB.php +++ b/app/Classes/OTF_DB.php @@ -3,21 +3,22 @@ * Created by PhpStorm. * User: taylorbroad * Date: 3/8/17 - * Time: 2:16 AM + * Time: 2:16 AM. * * Original file by Luke Evers */ namespace App\Classes; -use Illuminate\Support\Facades\Config; use Illuminate\Support\Facades\DB; +use Illuminate\Support\Facades\Config; -class OTF_DB { +class OTF_DB +{ /** * The name of the database we're connecting to on the fly. * - * @var string $database + * @var string */ protected $database; /** @@ -26,23 +27,24 @@ class OTF_DB { * @var \Illuminate\Database\Connection */ protected $connection; + /** * Create a new on the fly database connection. * * @param array $options + * * @return void */ public function __construct($options = null) { // Set the database - $database = $options['database']; + $database = $options['database']; $this->database = $database; // Figure out the driver and get the default configuration for the driver - $driver = isset($options['driver']) ? $options['driver'] : Config::get("database.default"); + $driver = isset($options['driver']) ? $options['driver'] : Config::get('database.default'); $default = Config::get("database.connections.$driver"); // Loop through our default array and update options if we have non-defaults - foreach($default as $item => $value) - { + foreach ($default as $item => $value) { $default[$item] = isset($options[$item]) ? $options[$item] : $default[$item]; } // Set the temporary configuration @@ -50,6 +52,7 @@ public function __construct($options = null) // Create the connection $this->connection = DB::connection($database); } + /** * Get the on the fly connection. * @@ -59,14 +62,16 @@ public function getConnection() { return $this->connection; } + /** * Get a table from the on the fly connection. * - * @var string $table + * @var string + * * @return \Illuminate\Database\Query\Builder */ public function getTable($table = null) { return $this->getConnection()->table($table); } -} \ No newline at end of file +} diff --git a/app/Classes/VAOSData.php b/app/Classes/VAOSData.php index 8c9a3b15..3fdc3637 100644 --- a/app/Classes/VAOSData.php +++ b/app/Classes/VAOSData.php @@ -3,19 +3,17 @@ * Created by PhpStorm. * User: taylorbroad * Date: 10/23/16 - * Time: 10:16 PM + * Time: 10:16 PM. */ - namespace App\Classes; /** - * VAOSData Helper for Central System Data - * @package App\Classes + * VAOSData Helper for Central System Data. */ class VAOSData { - function __construct() + public function __construct() { } -} \ No newline at end of file +} diff --git a/app/Classes/VAOSHelpers.php b/app/Classes/VAOSHelpers.php index 2b5d9cdd..f146a951 100644 --- a/app/Classes/VAOSHelpers.php +++ b/app/Classes/VAOSHelpers.php @@ -3,12 +3,11 @@ * Created by PhpStorm. * User: taylorbroad * Date: 11/26/16 - * Time: 2:25 AM + * Time: 2:25 AM. */ namespace App\Classes; - class VAOSHelpers { /** @@ -17,23 +16,24 @@ class VAOSHelpers * @param $lat2 * @param $lon2 * @param $unit + * * @return float */ - static function getDistance($lat1, $lon1, $lat2, $lon2, $unit) { - + public static function getDistance($lat1, $lon1, $lat2, $lon2, $unit) + { $theta = $lon1 - $lon2; - $dist = sin(deg2rad($lat1)) * sin(deg2rad($lat2)) + cos(deg2rad($lat1)) * cos(deg2rad($lat2)) * cos(deg2rad($theta)); - $dist = acos($dist); - $dist = rad2deg($dist); + $dist = sin(deg2rad($lat1)) * sin(deg2rad($lat2)) + cos(deg2rad($lat1)) * cos(deg2rad($lat2)) * cos(deg2rad($theta)); + $dist = acos($dist); + $dist = rad2deg($dist); $miles = $dist * 60 * 1.1515; - $unit = strtoupper($unit); + $unit = strtoupper($unit); - if ($unit == "K") { - return ($miles * 1.609344); - } else if ($unit == "N") { - return ($miles * 0.8684); + if ($unit == 'K') { + return $miles * 1.609344; + } elseif ($unit == 'N') { + return $miles * 0.8684; } else { return $miles; } } -} \ No newline at end of file +} diff --git a/app/Classes/VAOS_Aircraft.php b/app/Classes/VAOS_Aircraft.php index a1e1e66b..d812644c 100644 --- a/app/Classes/VAOS_Aircraft.php +++ b/app/Classes/VAOS_Aircraft.php @@ -3,99 +3,96 @@ * Created by PhpStorm. * User: taylorbroad * Date: 10/24/16 - * Time: 12:58 AM + * Time: 12:58 AM. */ namespace App\Classes; -use App\Models\AircraftGroup; use App\Models\Airline; -use App\Models\Aircraft; use App\Models\Airport; +use App\Models\Aircraft; +use App\Models\AircraftGroup; use Illuminate\Support\Facades\DB; /** - * Aircraft Data Class for system handling - * @package App\Classes + * Aircraft Data Class for system handling. */ class VAOS_Aircraft { /** * Creates a new aircraft within the database. Passes an array. + * * @param $data + * * @return bool */ public static function createAircraft($data) { $acf = new Aircraft(); //try - $acf->icao = $data['icao']; - $acf->name = $data['name']; - $acf->manufacturer = $data['manufacturer']; - $acf->registration = $data['registration']; - //$acf->range = $data['range']; - //$acf->maxpax = $data['maxpax']; - //$acf->maxgw = $data['maxgw']; - $acf->status = $data['status']; - - // time for the optional stuff - - // If we have a hub, assiciate it. - if (array_key_exists('hub', $data)) { - $hub = Airport::find($data['hub']); - $acf->hub()->associate($hub); - - // and while we're at it, lets set that as the current location - - $acf->location()->associate($hub); - } - $air = null; - if (array_key_exists('airline', $data)) { - //dd($data); - $air = Airline::where('icao', $data['airline'])->first(); - - $acf->airline()->associate($air); - } - - // Now the extremely fun part. Figuring out the aircraft group. - // Aircraft Groups are both User Defined and System Defined. - // First, we want to check if there is an aircraft group that already exists for this type. + $acf->icao = $data['icao']; + $acf->name = $data['name']; + $acf->manufacturer = $data['manufacturer']; + $acf->registration = $data['registration']; + //$acf->range = $data['range']; + //$acf->maxpax = $data['maxpax']; + //$acf->maxgw = $data['maxgw']; + $acf->status = $data['status']; + + // time for the optional stuff + + // If we have a hub, assiciate it. + if (array_key_exists('hub', $data)) { + $hub = Airport::find($data['hub']); + $acf->hub()->associate($hub); + + // and while we're at it, lets set that as the current location + + $acf->location()->associate($hub); + } + $air = null; + if (array_key_exists('airline', $data)) { + //dd($data); + $air = Airline::where('icao', $data['airline'])->first(); + + $acf->airline()->associate($air); + } + + // Now the extremely fun part. Figuring out the aircraft group. + // Aircraft Groups are both User Defined and System Defined. + // First, we want to check if there is an aircraft group that already exists for this type. //dd($acf); - $acf->save(); - //dd($acf); - if (DB::table('aircraft_groups')->where([ + $acf->save(); + //dd($acf); + if (DB::table('aircraft_groups')->where([ ['icao', '=', $data['icao']], ['userdefined', '=', 'false'], - ['airline_id', '=', $air->id] - ])->first() === null ) - { - // We didn't find it so lets create one real quick - $group = new AircraftGroup([ - 'name' => $data['name'], - 'icao' => $data['icao'], - 'userdefined' => false + ['airline_id', '=', $air->id], + ])->first() === null) { + // We didn't find it so lets create one real quick + $group = new AircraftGroup([ + 'name' => $data['name'], + 'icao' => $data['icao'], + 'userdefined' => false, ]); - $group->airline()->associate($air); - // now lets associate the aircraft with the new group. - $group->save(); - } - else - { - $group = AircraftGroup::where(['icao' => $data['icao'], 'userdefined' => false, 'airline_id' => $air->id])->first(); - } - $acf->aircraft_group()->attach($group); - // - // Now that is done, lets check if we want to add it to a user defined group. - if (array_key_exists('group', $data)) - { - $acf->aircraft_group()->attach($data['group']); - } - - // finally save the entire stack - - $acf->save(); - - return true; + $group->airline()->associate($air); + // now lets associate the aircraft with the new group. + $group->save(); + } else { + $group = AircraftGroup::where(['icao' => $data['icao'], 'userdefined' => false, 'airline_id' => $air->id])->first(); + } + $acf->aircraft_group()->attach($group); + // + // Now that is done, lets check if we want to add it to a user defined group. + if (array_key_exists('group', $data)) { + $acf->aircraft_group()->attach($data['group']); + } + + // finally save the entire stack + + $acf->save(); + + return true; //} //catch (\Exception $e) //{ @@ -109,14 +106,14 @@ public static function updateAircraft($data, $id) //try //{ - $acf->icao = $data['icao']; - $acf->name = $data['name']; + $acf->icao = $data['icao']; + $acf->name = $data['name']; $acf->manufacturer = $data['manufacturer']; $acf->registration = $data['registration']; - $acf->range = $data['range']; - $acf->maxpax = $data['maxpax']; - $acf->maxgw = $data['maxgw']; - $acf->status = $data['status']; + $acf->range = $data['range']; + $acf->maxpax = $data['maxpax']; + $acf->maxgw = $data['maxgw']; + $acf->status = $data['status']; // time for the optional stuff $air = null; @@ -139,21 +136,18 @@ public static function updateAircraft($data, $id) // Aircraft Groups are both User Defined and System Defined. // First, we want to check if there is an aircraft group that already exists for this type. $acf->save(); - if (AircraftGroup::where(['icao' => $data['icao'], 'userdefined' => false, 'airline_id' => $air ])->first() === null ) - { + if (AircraftGroup::where(['icao' => $data['icao'], 'userdefined' => false, 'airline_id' => $air])->first() === null) { // We didn't find it so lets create one real quick $group = new AircraftGroup([ - 'name' => $data['name'], - 'icao' => $data['icao'], - 'airline_id' => $air->id, - 'userdefined' => false + 'name' => $data['name'], + 'icao' => $data['icao'], + 'airline_id' => $air->id, + 'userdefined' => false, ]); // now lets associate the aircraft with the new group. $group->save(); - } - else - { - $group = AircraftGroup::where(['icao' => $data['icao'], 'userdefined' => false ])->first(); + } else { + $group = AircraftGroup::where(['icao' => $data['icao'], 'userdefined' => false])->first(); } // Detach all existing aircraft group associations @@ -163,8 +157,7 @@ public static function updateAircraft($data, $id) $acf->aircraft_group()->attach($group); // // Now that is done, lets check if we want to add it to a user defined group. - if (array_key_exists('group', $data)) - { + if (array_key_exists('group', $data)) { $acf->aircraft_group()->attach($data['group']); } @@ -179,6 +172,7 @@ public static function updateAircraft($data, $id) // return false; //} } + public function deleteAircraft($id) { // First remove the aircraft from the aircraft group. @@ -190,4 +184,4 @@ public function deleteAircraft($id) return true; } -} \ No newline at end of file +} diff --git a/app/Classes/VAOS_Airline.php b/app/Classes/VAOS_Airline.php index 35baf387..a527d6ed 100644 --- a/app/Classes/VAOS_Airline.php +++ b/app/Classes/VAOS_Airline.php @@ -3,20 +3,20 @@ * Created by PhpStorm. * User: taylorbroad * Date: 1/1/18 - * Time: 7:20 PM + * Time: 7:20 PM. */ namespace App\Classes; - class VAOS_Airline { public function newAirline($data) { // } + public function addUserToAirline($airline_id, $user_id) { // } -} \ No newline at end of file +} diff --git a/app/Classes/VAOS_Airports.php b/app/Classes/VAOS_Airports.php index 40f452d7..21b8d3ef 100644 --- a/app/Classes/VAOS_Airports.php +++ b/app/Classes/VAOS_Airports.php @@ -3,13 +3,13 @@ * Created by PhpStorm. * User: taylorbroad * Date: 10/25/16 - * Time: 1:07 AM + * Time: 1:07 AM. */ namespace App\Classes; -use App\Models\Airport; use GuzzleHttp\Client; +use App\Models\Airport; class VAOS_Airports { @@ -17,30 +17,27 @@ public static function AddAirport($icao) { // lets request the airport identifier from the central database $client = new Client(); - $res = $client->request('GET', 'http://fsvaos.net/api/data/airports', [ + $res = $client->request('GET', 'http://fsvaos.net/api/data/airports', [ 'query' => [ 'icao' => $icao, - ] + ], ])->getBody(); // Add the airport to the database - $data = json_decode($res, true); + $data = json_decode($res, true); $airport = new Airport(); // return dd($icao); try { - $airport->id = $data['airport']['id']; - $airport->name = $data['airport']['name']; - $airport->icao = $data['airport']['gps_code']; - $airport->iata = $data['airport']['iata_code']; - $airport->lat = $data['airport']['latitude_deg']; - $airport->lon = $data['airport']['longitude_deg']; - $airport->city = $data['airport']['municipality']; + $airport->id = $data['airport']['id']; + $airport->name = $data['airport']['name']; + $airport->icao = $data['airport']['gps_code']; + $airport->iata = $data['airport']['iata_code']; + $airport->lat = $data['airport']['latitude_deg']; + $airport->lon = $data['airport']['longitude_deg']; + $airport->city = $data['airport']['municipality']; $airport->country = $data['airport']['iso_country']; - } - catch (Exception $e) - { + } catch (Exception $e) { return dd($data); - } $airport->save(); } -} \ No newline at end of file +} diff --git a/app/Classes/VAOS_DRM.php b/app/Classes/VAOS_DRM.php index 7832e590..048e0b4a 100644 --- a/app/Classes/VAOS_DRM.php +++ b/app/Classes/VAOS_DRM.php @@ -3,16 +3,15 @@ * Created by PhpStorm. * User: taylorbroad * Date: 1/1/18 - * Time: 7:21 PM + * Time: 7:21 PM. */ namespace App\Classes; - class VAOS_DRM { public function licenseCheck() { // } -} \ No newline at end of file +} diff --git a/app/Classes/VAOS_Events.php b/app/Classes/VAOS_Events.php index 8956544c..bda44603 100644 --- a/app/Classes/VAOS_Events.php +++ b/app/Classes/VAOS_Events.php @@ -3,12 +3,11 @@ * Created by PhpStorm. * User: taylorbroad * Date: 1/2/18 - * Time: 3:46 AM + * Time: 3:46 AM. */ namespace App\Classes; - use App\Models\AirlineEvent; class VAOS_Events @@ -17,64 +16,71 @@ public static function createEvent($data) { $event = new AirlineEvent(); - $event->name = $data['name']; + $event->name = $data['name']; $event->description = $data['description']; - if(!isNull($data['max_users'])) { + if (! isNull($data['max_users'])) { $event->max_users = $data['max_users']; } - if(!isNull($data['banner_url'])) { + if (! isNull($data['banner_url'])) { $event->banner_url = $data['banner_url']; } - $event->access = $data['access']; - $event->scope = $data['scope']; + $event->access = $data['access']; + $event->scope = $data['scope']; $event->publishToNetwork = false; - if(!isNull($data['start_time'])) { + if (! isNull($data['start_time'])) { $event->start = $data['start_time']; } - if(!isNull($data['type'])) { + if (! isNull($data['type'])) { $event->type = $data['type']; } - if(!isNull($data['end_time'])) { + if (! isNull($data['end_time'])) { $event->end = $data['end_time']; } $event->save(); } + public static function joinEvent($event_id, $user) { $event = AirlineEvent::find($event_id); $event->users()->attach($user, ['status' => 1]); } + public static function leaveEvent($event_id, $user) { $event = AirlineEvent::find($event_id); $event->users()->detach($user); } + public static function modifyEvent($event, $data) { // } + public static function removeEvent($event_id) { $event = AirlineEvent::find($event_id); $event->delete(); } + public static function dispatchFlights($event_id, $user_id = null) { // TODO: Add event flights to flights. Optional: Individual add flights to flights. Especially when dealing with a larger event. - } + public static function addEventFlight($event_id, $flightInfo) { // } + public static function removeEventFlight($event_id, $flight_id) { // } + public static function modifyEventFlight($devent_id, $flightInfo) { // } -} \ No newline at end of file +} diff --git a/app/Classes/VAOS_Flights.php b/app/Classes/VAOS_Flights.php index 0c6bcdfe..11630ac2 100644 --- a/app/Classes/VAOS_Flights.php +++ b/app/Classes/VAOS_Flights.php @@ -3,7 +3,7 @@ * Created by PhpStorm. * User: taylorbroad * Date: 5/13/18 - * Time: 8:24 PM + * Time: 8:24 PM. */ namespace App\Classes; @@ -16,12 +16,14 @@ public static function CreateNewFlight() { return E_USER_DEPRECATED; } + public static function addGroupFlightToUser($user, $group_flight) { // } + public static function duplicateFlight($user, $flight, $flightnum = null) { // first get the flight. } -} \ No newline at end of file +} diff --git a/app/Classes/VAOS_ImportExport.php b/app/Classes/VAOS_ImportExport.php index 61fbe918..4e5c3278 100644 --- a/app/Classes/VAOS_ImportExport.php +++ b/app/Classes/VAOS_ImportExport.php @@ -3,19 +3,18 @@ * Created by PhpStorm. * User: taylorbroad * Date: 1/6/17 - * Time: 3:29 AM + * Time: 3:29 AM. */ namespace App\Classes; -use Illuminate\Support\Facades\Input; -use Illuminate\Support\Facades\Storage; use Maatwebsite\Excel\Facades\Excel; class VAOS_ImportExport { public static function importFleet(AircraftListExcel $file) { - Excel::load($file, function($reader) {})->get(); + Excel::load($file, function ($reader) { + })->get(); } -} \ No newline at end of file +} diff --git a/app/Classes/VAOS_Schedule.php b/app/Classes/VAOS_Schedule.php index 299edbc1..66b18050 100644 --- a/app/Classes/VAOS_Schedule.php +++ b/app/Classes/VAOS_Schedule.php @@ -3,18 +3,16 @@ * Created by PhpStorm. * User: taylorbroad * Date: 10/23/16 - * Time: 8:55 PM + * Time: 8:55 PM. */ namespace App\Classes; - -use App\Models\AircraftGroup; -use App\Models\Airport; use App\Models\Airline; -use App\Models\Flight as ScheduleComplete; +use App\Models\Airport; use App\Models\Schedule; -use Carbon\Carbon; +use App\Models\AircraftGroup; +use App\Models\Flight as ScheduleComplete; class VAOS_Schedule { @@ -24,7 +22,7 @@ public static function fileBid($user_id, $schedule_id, $aircraft_id = null) $template = Schedule::where('id', $schedule_id)->with('depapt')->with('arrapt')->with('airline')->with('aircraft_group')->first(); // $template = Schedule::where('id', $request->query('schedule_id'))->first(); // Now let's turn the aircraft group into a assigned aircraft. - /** + /* * New in 2.0 We now have multiple aircraft groups and aircraft assigned to a single object. Let's do ourselves * a favor and let's get priorities straight. * @@ -33,45 +31,38 @@ public static function fileBid($user_id, $schedule_id, $aircraft_id = null) * Aircraft will first be checked to see if they are available. This will be done via the Model directly. */ - if ($template->aircraft_group != null) - { - foreach($template->aircraft_group as $a) - { - if ($a['pivot']['primary']) - { + if ($template->aircraft_group != null) { + foreach ($template->aircraft_group as $a) { + if ($a['pivot']['primary']) { $acfgrp = AircraftGroup::where('id', $a->id)->with('aircraft')->first(); // ok, run an availability check. - foreach ($acfgrp->aircraft as $acf) - { - if($acf->isAvailable()) - { + foreach ($acfgrp->aircraft as $acf) { + if ($acf->isAvailable()) { $complete->aircraft()->associate($acf); - } } } } } - //$acfgrp = AircraftGroup::where('id', $template->aircraft_group->pivot->primary)->with('aircraft')->first(); - else + //$acfgrp = AircraftGroup::where('id', $template->aircraft_group->pivot->primary)->with('aircraft')->first(); + else { $acfgrp = AircraftGroup::with('aircraft')->first(); + } // ok lets assign the first aircraft on the list - - - // First let's bring all the foreign keys from the previous table into this one. $complete->airline()->associate($template->airline); $complete->depapt()->associate($template->depapt); $complete->arrapt()->associate($template->arrapt); //dd($acfgrp); - if ($aircraft_id === null) + if ($aircraft_id === null) { $complete->aircraft()->associate($acfgrp->aircraft[0]); - else + } else { $complete->aircraft()->associate($aircraft_id); + } $complete->user()->associate($user_id); @@ -80,9 +71,9 @@ public static function fileBid($user_id, $schedule_id, $aircraft_id = null) $defaults = json_decode($template->defaults); $complete->flightnum = $template->flightnum; - $complete->route = $defaults['route']; + $complete->route = $defaults['route']; // Now lets encode the cruise altitude in the JSON - $rte_data = array(); + $rte_data = []; $rte_data['cruise'] = $defaults['cruise']; // store it @@ -91,30 +82,28 @@ public static function fileBid($user_id, $schedule_id, $aircraft_id = null) $complete->deptime = null; $complete->arrtime = null; - $complete->load = 0; - $complete->state = 0; + $complete->load = 0; + $complete->state = 0; $complete->save(); return true; } + public static function newRoute($data) { // Declare a new instance of the Schedule Model $entry = new Schedule(); //dd($request); // Before we add the route, lets check to see if the airport exists. - if (Airport::where('icao', $data['depicao'])->first() === null) - { + if (Airport::where('icao', $data['depicao'])->first() === null) { VAOS_Airports::AddAirport($data['depicao']); } - if (Airport::where('icao', $data['arricao'])->first() === null) - { + if (Airport::where('icao', $data['arricao'])->first() === null) { VAOS_Airports::AddAirport($data['arricao']); } // add the form elements // Search for the airline in the database - $entry->flightnum = $data['flightnum']; // Setup the foreign keys. Lets now find the new airports @@ -126,12 +115,10 @@ public static function newRoute($data) $airline = Airline::where('icao', $data['airline'])->first(); $entry->airline()->associate($airline); - if (array_key_exists('alticao', $data)) - { + if (array_key_exists('alticao', $data)) { $entry->alticao = $data['alticao']; } - if (array_key_exists('route', $data)) - { + if (array_key_exists('route', $data)) { $entry->route = $data['route']; } //dd($data); @@ -139,41 +126,35 @@ public static function newRoute($data) $entry->seasonal = false; //$entry->daysofweek = "0123456"; $entry->type = $data['type']; - if (array_key_exists('enabled', $data)) - { + if (array_key_exists('enabled', $data)) { $entry->enabled = $data['enabled']; - } - else - { + } else { $entry->enabled = 1; } $entry->save(); - if (array_key_exists('aircraft_group', $data)) - { + if (array_key_exists('aircraft_group', $data)) { //dd($data); // $acfgrp = AircraftGroup::where('icao', ($data['aircraft_group']))->first(); $entry->aircraft_group()->attach($data['aircraft_group'], ['primary' => true]); } $entry->save(); } + public static function updateRoute($data, $id) { // Declare a new instance of the Schedule Model $entry = Schedule::find($id); //dd($request); // Before we add the route, lets check to see if the airport exists. - if (Airport::where('icao', $data['depicao'])->first() === null) - { + if (Airport::where('icao', $data['depicao'])->first() === null) { VAOS_Airports::AddAirport($data['depicao']); } - if (Airport::where('icao', $data['arricao'])->first() === null) - { + if (Airport::where('icao', $data['arricao'])->first() === null) { VAOS_Airports::AddAirport($data['arricao']); } // add the form elements // Search for the airline in the database - $entry->flightnum = $data['flightnum']; // Setup the foreign keys. Lets now find the new airports @@ -185,17 +166,14 @@ public static function updateRoute($data, $id) $airline = Airline::where('icao', $data['airline'])->first(); $entry->airline()->associate($airline); - if (array_key_exists('alticao', $data)) - { + if (array_key_exists('alticao', $data)) { $entry->alticao = $data['alticao']; } - if (array_key_exists('route', $data)) - { + if (array_key_exists('route', $data)) { $entry->route = $data['route']; } //dd($data); - if (array_key_exists('aircraft_group', $data)) - { + if (array_key_exists('aircraft_group', $data)) { //dd($data); $acfgrp = $acfgrp = AircraftGroup::where('icao', ($data['aircraft_group']))->first(); $entry->aircraft_group()->associate($acfgrp); @@ -203,22 +181,21 @@ public static function updateRoute($data, $id) $entry->seasonal = true; //$entry->daysofweek = "0123456"; $entry->type = $data['type']; - if (array_key_exists('enabled', $data)) - { + if (array_key_exists('enabled', $data)) { $entry->enabled = $data['enabled']; - } - else - { + } else { $entry->enabled = 1; } $entry->save(); } + public static function deleteBid($flight_id, $user_id = null) { - if (is_null($user_id)) + if (is_null($user_id)) { $flight = ScheduleComplete::find($flight_id); - else + } else { $flight = ScheduleComplete::where(['user_id' => $user_id, 'id' => $flight_id])->firstOrFail(); + } $flight->delete(); } diff --git a/app/Classes/VAOS_TypeRatings.php b/app/Classes/VAOS_TypeRatings.php index a272eb0c..3a74636f 100644 --- a/app/Classes/VAOS_TypeRatings.php +++ b/app/Classes/VAOS_TypeRatings.php @@ -3,12 +3,11 @@ * Created by PhpStorm. * User: taylorbroad * Date: 3/5/18 - * Time: 1:57 PM + * Time: 1:57 PM. */ namespace App\Classes; - use App\Models\Airline; use App\Models\TypeRating; @@ -16,23 +15,26 @@ class VAOS_TypeRatings { public static function AddTypeRating($data) { - $tr = new TypeRating(); - $airline = Airline::find($data['airline']); + $tr = new TypeRating(); + $airline = Airline::find($data['airline']); $tr->code = $data['code']; $tr->name = $data['name']; $tr->airline()->associate($airline); $tr->save(); } + public static function ModifyTypeRating($rating_id, $data) { // } + public static function AddUserToTypeRating($rating_id, $user_id) { // } - public static Function VerifyRating($rating_id, $user_id) + + public static function VerifyRating($rating_id, $user_id) { // } -} \ No newline at end of file +} diff --git a/app/Classes/VATSIMData.php b/app/Classes/VATSIMData.php index 3576b8f1..7d55c7ee 100644 --- a/app/Classes/VATSIMData.php +++ b/app/Classes/VATSIMData.php @@ -3,14 +3,14 @@ * Created by PhpStorm. * User: taylorbroad * Date: 7/1/18 - * Time: 3:20 PM + * Time: 3:20 PM. */ namespace App\Classes; -use App\Models\ACARSData; use App\Models\Flight; use GuzzleHttp\Client; +use App\Models\ACARSData; class VATSIMData { @@ -18,14 +18,13 @@ public static function run() { $allFlights = Flight::where('state', '<=', 1)->with('airline')->get(); //dd($allFlights->count()); - foreach ($allFlights as $flight) - { + foreach ($allFlights as $flight) { $flight->combi = $flight->airline->icao.$flight->flightnum; //dd($flight); } // get the VATSIM data text file. $client = new Client(); - $res = $client->request('GET', 'http://info.vroute.net/vatsim-data.txt', [ + $res = $client->request('GET', 'http://info.vroute.net/vatsim-data.txt', [ ])->getBody(); @@ -34,20 +33,17 @@ public static function run() // Get a list of active flights in our system and let's find the flights on the VATSIM status - foreach($allFlights as $flight) - { - foreach($data_lines as $line) - { - if (strpos($line, $flight->combi) !== false) - { + foreach ($allFlights as $flight) { + foreach ($data_lines as $line) { + if (strpos($line, $flight->combi) !== false) { // Awesome, we found the flight. Now we need to split the array out and store the data. $data = explode(':', $line); // double check if it's a pre-file or not. If so, don't do anything. - if($data[5] === null) + if ($data[5] === null) { break; + } // Let's check the state of the flight. If it's filed, we need to set it as active - if ($flight['state'] === 0) - { + if ($flight['state'] === 0) { $flight->state = 1; $flight->save(); } @@ -56,15 +52,15 @@ public static function run() $rpt = new ACARSData(); $rpt->user()->associate($flight->user->id); $rpt->bid()->associate($flight); - $rpt->lat = $data[5]; - $rpt->lon = $data[6]; - $rpt->heading = $data[38]; - $rpt->altitude = $data[7]; - $rpt->groundspeed = $data[8]; - $rpt->phase = "N/A"; - $rpt->online = true; + $rpt->lat = $data[5]; + $rpt->lon = $data[6]; + $rpt->heading = $data[38]; + $rpt->altitude = $data[7]; + $rpt->groundspeed = $data[8]; + $rpt->phase = 'N/A'; + $rpt->online = true; $rpt->timeremaining = '0'; - $rpt->client = 'vatsim'; + $rpt->client = 'vatsim'; $rpt->save(); // update the flight with the current tracking information. @@ -73,11 +69,10 @@ public static function run() $flight->lon = $data[6]; //$flight->heading = $data[38]; $flight->altitude = $data[7]; - $flight->gs = $data[8]; + $flight->gs = $data[8]; $flight->save(); break; } - } } /* @@ -90,6 +85,6 @@ public static function run() // ok that's all the active flights. Now just in case, let's double check to see if we can find any aircraft // that our members have in their personal fleet being flown, add those flights to the system. - return "ok"; + return 'ok'; } -} \ No newline at end of file +} diff --git a/app/Classes/phpVMSLegacy.php b/app/Classes/phpVMSLegacy.php index 459b01e8..3ec91441 100644 --- a/app/Classes/phpVMSLegacy.php +++ b/app/Classes/phpVMSLegacy.php @@ -3,25 +3,29 @@ * Created by PhpStorm. * User: taylorbroad * Date: 11/11/16 - * Time: 6:07 PM + * Time: 6:07 PM. */ namespace App\Classes; -use App\Airline; + use App\Flight; +use App\Airline; + /** * Helper Class that converts phpVMS formatted data into VAOS friendly stuff. - * Class phpVMSLegacy - * @package App\Classes + * Class phpVMSLegacy. */ class phpVMSLegacy { - public static function getFlightBid($flightnum, $userid) { - if ($flightnum == '') return false; + public static function getFlightBid($flightnum, $userid) + { + if ($flightnum == '') { + return false; + } - $ret = array(); + $ret = []; $flightnum = strtoupper($flightnum); - $airlines = Airline::all(); + $airlines = Airline::all(); foreach ($airlines as $a) { $a->icao = strtoupper($a->icao); @@ -30,18 +34,18 @@ public static function getFlightBid($flightnum, $userid) { continue; } - $ret['icao'] = $a->icao; + $ret['icao'] = $a->icao; $ret['flightnum'] = str_ireplace($a->icao, '', $flightnum); // ok now that we deduced that, let's find the bid. - return Flight::where(['user_id' => $userid, 'airline_id' => $a->id, 'flightnum' => $ret['flightnum']])->first(); } - # Invalid flight number - $ret['code'] = ''; + // Invalid flight number + $ret['code'] = ''; $ret['flightnum'] = $flightnum; + return Flight::where(['user_id' => $userid, 'flightnum' => $ret['flightnum']])->first(); } -} \ No newline at end of file +} diff --git a/app/Console/Commands/VAOSNewAirline.php b/app/Console/Commands/VAOSNewAirline.php index cc21d5a6..59463cf9 100644 --- a/app/Console/Commands/VAOSNewAirline.php +++ b/app/Console/Commands/VAOSNewAirline.php @@ -38,14 +38,14 @@ public function __construct() */ public function handle() { - $name = $this->ask('Airline Name:'); - $icao = $this->ask('ICAO:'); + $name = $this->ask('Airline Name:'); + $icao = $this->ask('ICAO:'); $callsign = $this->ask('Callsign:'); $airline = new Airline([ - 'name' => $name, - 'icao' => $icao, - 'callsign' => $callsign + 'name' => $name, + 'icao' => $icao, + 'callsign' => $callsign, ]); $airline->save(); $this->info('Airline Created'); diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index 5507045f..d12a1085 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -2,7 +2,6 @@ namespace App\Console; -use App\Classes\VATSIMData; use Illuminate\Console\Scheduling\Schedule; use Illuminate\Foundation\Console\Kernel as ConsoleKernel; @@ -17,13 +16,14 @@ class Kernel extends ConsoleKernel // Commands\InstallphpVMSTables::class, Commands\VAOSNewAirline::class, - Commands\VatsimStatus::class + Commands\VatsimStatus::class, ]; /** * Define the application's command schedule. * * @param \Illuminate\Console\Scheduling\Schedule $schedule + * * @return void */ protected function schedule(Schedule $schedule) diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index 2e293ac2..3e19a57d 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -28,6 +28,7 @@ class Handler extends ExceptionHandler * This is a great spot to send exceptions to Sentry, Bugsnag, etc. * * @param \Exception $exception + * * @return void */ public function report(Exception $exception) @@ -40,11 +41,15 @@ public function report(Exception $exception) * * @param \Illuminate\Http\Request $request * @param \Exception $exception + * * @return \Illuminate\Http\Response */ public function render($request, Exception $exception) { - if ($request->expectsJson()) return response()->json(['status' => 500, 'exception' => $exception]); + if ($request->expectsJson()) { + return response()->json(['status' => 500, 'exception' => $exception]); + } + return parent::render($request, $exception); } @@ -53,6 +58,7 @@ public function render($request, Exception $exception) * * @param \Illuminate\Http\Request $request * @param \Illuminate\Auth\AuthenticationException $exception + * * @return \Illuminate\Http\Response */ protected function unauthenticated($request, AuthenticationException $exception) diff --git a/app/Helpers/settings.php b/app/Helpers/settings.php index e8dcb5e9..5e23cb8b 100644 --- a/app/Helpers/settings.php +++ b/app/Helpers/settings.php @@ -3,16 +3,15 @@ * Created by PhpStorm. * User: taylorbroad * Date: 12/28/17 - * Time: 11:06 PM + * Time: 11:06 PM. */ - function dbSetting($key) { return $value = \App\Models\SystemSetting::where('key', $key)->first(); } /** - * Permissions Helper + * Permissions Helper. * * This function calls the permissions table and returns a boolean if they can do the requested function. Permissions * are separated by airline. @@ -21,4 +20,4 @@ function permCheck($user, $key, $airline) { // \Illuminate\Support\Facades\Log::warn('Key Not Found. Proceeding with true response.'); -} \ No newline at end of file +} diff --git a/app/Http/Controllers/API/ACARS_SessionAPI.php b/app/Http/Controllers/API/ACARS_SessionAPI.php index c86e1de3..5ca23793 100644 --- a/app/Http/Controllers/API/ACARS_SessionAPI.php +++ b/app/Http/Controllers/API/ACARS_SessionAPI.php @@ -5,17 +5,13 @@ use App\ACARS_Session; use Illuminate\Http\Request; -use App\Http\Requests; - /** - * ACARS Global Session Management - * @package App\Http\Controllers\API + * ACARS Global Session Management. */ class ACARS_SessionAPI extends Controller { public function addSession(Request $request) { $acars = new ACARS_Session(); - } } diff --git a/app/Http/Controllers/API/AcarsAPI.php b/app/Http/Controllers/API/AcarsAPI.php index 221089bc..1f4dea66 100644 --- a/app/Http/Controllers/API/AcarsAPI.php +++ b/app/Http/Controllers/API/AcarsAPI.php @@ -2,27 +2,23 @@ namespace App\Http\Controllers\API; -use App\ACARSData; -use App\Airline; +use App\User; +use stdClass; use App\Flight; +use App\Airline; +use App\ACARSData; use App\Models\Aircraft; -use App\Models\Airport; -use App\ScheduleComplete; -use App\User; use Illuminate\Http\Request; -use stdClass; - class AcarsAPI extends Controller { public function position(Request $request) { - $report = array(); + $report = []; // First off, lets establish the format. Is this phpvms? - if ($request->query('format') == 'phpVMS') - { + if ($request->query('format') == 'phpVMS') { // well shoot, we got a legacy ACARS client. Let's sterilize the data and format the input. - $report['user'] = User::find($request->input('pilotid')); + $report['user'] = User::find($request->input('pilotid')); $report['user_id'] = $request->input('pilotid'); // split the flight string the phpVMS way into Airline Code and Flight Number. // Why they did this is beyond me. Foreign keys are another story..... @@ -33,9 +29,9 @@ public function position(Request $request) //$report['aircraft'] = Aircraft::where('registration', $request->input('registration'))->first(); $report['lat'] = $request->input('lat'); // Lets convert lng to lon. Play with the big boys now - $report['lon'] = $request->input('lng'); - $report['heading'] = $request->input('heading'); - $report['altitude'] = $request->input('alt'); + $report['lon'] = $request->input('lng'); + $report['heading'] = $request->input('heading'); + $report['altitude'] = $request->input('alt'); $report['groundspeed'] = $request->input('gs'); /* 'deptime' @@ -45,11 +41,9 @@ public function position(Request $request) 'timeremaining' 'phasedetail' */ - $report['phase'] = $request->input('phasedetail'); + $report['phase'] = $request->input('phasedetail'); $report['client'] = $request->input('client'); - } - else - { + } else { return response()->json([ 'status' => 800, ]); @@ -58,30 +52,36 @@ public function position(Request $request) $rpt = ACARSData::firstOrNew(['bid_id' => $report['bid']]); $rpt->user()->associate($report['user']); $rpt->bid()->associate($report['bid']); - $rpt->lat = $report['lat']; - $rpt->lon = $report['lon']; - $rpt->heading = $report['heading']; - $rpt->altitude = $report['altitude']; + $rpt->lat = $report['lat']; + $rpt->lon = $report['lon']; + $rpt->heading = $report['heading']; + $rpt->altitude = $report['altitude']; $rpt->groundspeed = $report['groundspeed']; - $rpt->phase = $report['phase']; - $rpt->client = $report['client']; + $rpt->phase = $report['phase']; + $rpt->client = $report['client']; $rpt->save(); + return response()->json([ - 'status' => 200 + 'status' => 200, ]); } /** * phpVMS Legacy Compatibility Function. Splits the flightnum string into code and number. + * * @param $flightnum + * * @return array|bool */ - public static function getProperFlightNum($flightnum, $userid) { - if ($flightnum == '') return false; + public static function getProperFlightNum($flightnum, $userid) + { + if ($flightnum == '') { + return false; + } - $ret = array(); + $ret = []; $flightnum = strtoupper($flightnum); - $airlines = Airline::all(); + $airlines = Airline::all(); foreach ($airlines as $a) { $a->icao = strtoupper($a->icao); @@ -90,7 +90,7 @@ public static function getProperFlightNum($flightnum, $userid) { continue; } - $ret['icao'] = $a->icao; + $ret['icao'] = $a->icao; $ret['flightnum'] = str_ireplace($a->icao, '', $flightnum); // ok now that we deduced that, let's find the bid. @@ -98,40 +98,43 @@ public static function getProperFlightNum($flightnum, $userid) { return Flight::where(['user_id' => $userid, 'airline_id' => $a->id, 'flightnum' => $ret['flightnum']])->first(); } - # Invalid flight number - $ret['code'] = ''; + // Invalid flight number + $ret['code'] = ''; $ret['flightnum'] = $flightnum; + return Flight::where(['user_id' => $userid, 'flightnum' => $ret['flightnum']])->first(); } /** * Provide the live ACARS date for external apps in the VAOS way and a phpVMS Legacy Compatibility Function. + * * @param \Illuminate\Http\Request $request + * * @return \Illuminate\Http\JsonResponse|string */ - public static function getAcarsData(Request $request){ - + public static function getAcarsData(Request $request) + { $flights = ACARSData::with(['bid.airline', 'bid.aircraft', 'bid.depapt', 'bid.arrapt', 'user'])->get(); if ($request->query('format') == 'phpVMS') { - /** + /* * So here we are to make the magic happen that all external apps which use the old phpVMS format, work again * Treat it with respect, this won't be around for too much longer. */ - if(!$flights) - $flights = array(); + if (! $flights) { + $flights = []; + } $acarsflights = []; foreach ($flights as $flight) { - - if($flight->bid->route == '') { - $flight->bid->route_details = array(); + if ($flight->bid->route == '') { + $flight->bid->route_details = []; } else { - /** + /* * This is some old phpVMS shit to get the navdata for the route. * Does not work in VAOS yet. Will maybe become a feature in an upcoming update */ @@ -146,90 +149,88 @@ public static function getAcarsData(Request $request){ $flight->route_details = NavData::parseRoute($params); */ // No NavData so empty array instead - $flight->bid->route_details = array(); + $flight->bid->route_details = []; } - /** + /* * Some other unnecessary function, because all ACARS app's * provide heading nowadays. This function is in here * for the sake of completeness */ /* If no heading was passed via ACARS app then calculate it - This should probably move to inside the ACARSData function, so then - the heading is always there for no matter what the calculation is - */ + This should probably move to inside the ACARSData function, so then + the heading is always there for no matter what the calculation is + */ - if($flight->heading == '') { + if ($flight->heading == '') { /* Calculate an angle based on current coords and the destination coordinates */ $flight->heading = intval(atan2(($flight->lat - $flight->bid->arrapt->lat), ($flight->lon - $flight->bid->arrapt->lon)) * 180 / 3.14); //$flight->heading *= intval(180/3.14159); - if(($flight->lon - $flight->bid->arrapt->lon) < 0) { + if (($flight->lon - $flight->bid->arrapt->lon) < 0) { $flight->heading += 180; } - if($flight->heading < 0) { + if ($flight->heading < 0) { $flight->heading += 360; } } - - $data = new stdClass(); - $data->aircraft = (string) $flight->bid->aircraft->id; - $data->aircraftname = $flight->bid->aircraft->name; - $data->alt = $flight->altitude; - $data->arrapt = $flight->bid->arrapt->name; - $data->arricao = $flight->bid->arrapt->icao; - $data->arrlat = (string) $flight->bid->arrapt->lat; - $data->arrlng = (string) $flight->bid->arrapt->lon; - $data->arrname = $flight->bid->arrapt->name; - $data->arrtime = $flight->bid->arrtime; - $data->client = $flight->client; - $data->code = $flight->bid->airline->icao; - $data->depapt = $flight->bid->depapt->name; - $data->depicao = $flight->bid->depapt->icao; - $data->deplat = (string) $flight->bid->depapt->lat; - $data->deplng = (string) $flight->bid->depapt->lon; - $data->depname = $flight->bid->depapt->name; - $data->deptime = $flight->bid->deptime; - $data->distremain = $flight->distremaining; + $data = new stdClass(); + $data->aircraft = (string) $flight->bid->aircraft->id; + $data->aircraftname = $flight->bid->aircraft->name; + $data->alt = $flight->altitude; + $data->arrapt = $flight->bid->arrapt->name; + $data->arricao = $flight->bid->arrapt->icao; + $data->arrlat = (string) $flight->bid->arrapt->lat; + $data->arrlng = (string) $flight->bid->arrapt->lon; + $data->arrname = $flight->bid->arrapt->name; + $data->arrtime = $flight->bid->arrtime; + $data->client = $flight->client; + $data->code = $flight->bid->airline->icao; + $data->depapt = $flight->bid->depapt->name; + $data->depicao = $flight->bid->depapt->icao; + $data->deplat = (string) $flight->bid->depapt->lat; + $data->deplng = (string) $flight->bid->depapt->lon; + $data->depname = $flight->bid->depapt->name; + $data->deptime = $flight->bid->deptime; + $data->distremain = $flight->distremaining; $data->distremaining = $flight->distremaining; - $data->firstname = $flight->user->first_name; - $data->flightnum = $flight->bid->airline->icao.$flight->bid->flightnum; - $data->gs = (string) $flight->groundspeed; - $data->heading = (string) $flight->heading; - $data->id = (string) $flight->user->id; // phpVMS is this the user ID or something else? - $data->lastname = $flight->user->last_name; - $data->lastupdate = (string) $flight->updated_at; - $data->lat = (string) $flight->lat; - $data->lng = (string)$flight->lon; - $data->online = $flight->online; - $data->phasedetail = $flight->phase; - $data->pilotid = $flight->user->pilotid; // TODO Make pilot ID work - $data->pilotname = $flight->user->first_name.' '.$flight->user->last_name; - $data->registration = $flight->bid->aircraft->registration; - $data->route = $flight->bid->route; + $data->firstname = $flight->user->first_name; + $data->flightnum = $flight->bid->airline->icao.$flight->bid->flightnum; + $data->gs = (string) $flight->groundspeed; + $data->heading = (string) $flight->heading; + $data->id = (string) $flight->user->id; // phpVMS is this the user ID or something else? + $data->lastname = $flight->user->last_name; + $data->lastupdate = (string) $flight->updated_at; + $data->lat = (string) $flight->lat; + $data->lng = (string) $flight->lon; + $data->online = $flight->online; + $data->phasedetail = $flight->phase; + $data->pilotid = $flight->user->pilotid; // TODO Make pilot ID work + $data->pilotname = $flight->user->first_name.' '.$flight->user->last_name; + $data->registration = $flight->bid->aircraft->registration; + $data->route = $flight->bid->route; $data->route_details = $flight->bid->route_details; $data->timeremaining = $flight->timeremaining; + $c = (array) $data; - $c = (array)$data; - - /** + /* * phpVMS and VAOS normalize some data */ // Normalize the data - if($c['timeremaining'] == '') { + if ($c['timeremaining'] == '') { $c['timeremaining'] = '-'; } - if(trim($c['phasedetail']) == '') { + if (trim($c['phasedetail']) == '') { $c['phasedetail'] = 'Enroute'; } //VAOS normalize the data. This will be removed when the Todos are done - if ($c['route'] == ''){ + if ($c['route'] == '') { $c['route'] = ''; } @@ -237,11 +238,10 @@ public static function getAcarsData(Request $request){ } return json_encode($acarsflights); // Convert to json format - - }else{ + } else { return response()->json([ - 'status' => 200, - 'ACARSData' => $flights + 'status' => 200, + 'ACARSData' => $flights, ]); } } diff --git a/app/Http/Controllers/API/AirportsAPI.php b/app/Http/Controllers/API/AirportsAPI.php index 17589ec9..a7dde694 100644 --- a/app/Http/Controllers/API/AirportsAPI.php +++ b/app/Http/Controllers/API/AirportsAPI.php @@ -2,74 +2,73 @@ namespace App\Http\Controllers\API; -use Illuminate\Http\Request; -use \Illuminate\Support\Collection; -use App\Models\Airport; -use App\Http\Requests; use GuzzleHttp\Client; +use App\Models\Airport; +use Illuminate\Http\Request; class AirportsAPI extends Controller { // public function index() { - // return everything - return Airport::all(); + // return everything + return Airport::all(); } + public function add(Request $request) { - // lets request the airport identifier from the central database - $client = new Client(); - $res = $client->request('GET', 'http://fsvaos.net/api/central/airports', [ - 'query' => [ - 'icao' => $request->icao, - ] - ])->getBody(); - // Add the airport to the database - $data = json_decode($res, true); - $airport = new Airport(); - //return dd($data); - $airport->id = $data['airport']['id']; - $airport->name = $data['airport']['name']; - $airport->icao = $data['airport']['gps_code']; - $airport->lat = $data['airport']['latitude_deg']; - $airport->lon = $data['airport']['longitude_deg']; - $airport->country = $data['airport']['iso_country']; - - $airport->save(); - $ret = "Added ".$data[0]['name']. "to the database"; - return $ret; + // lets request the airport identifier from the central database + $client = new Client(); + $res = $client->request('GET', 'http://fsvaos.net/api/central/airports', [ + 'query' => [ + 'icao' => $request->icao, + ], + ])->getBody(); + // Add the airport to the database + $data = json_decode($res, true); + $airport = new Airport(); + //return dd($data); + $airport->id = $data['airport']['id']; + $airport->name = $data['airport']['name']; + $airport->icao = $data['airport']['gps_code']; + $airport->lat = $data['airport']['latitude_deg']; + $airport->lon = $data['airport']['longitude_deg']; + $airport->country = $data['airport']['iso_country']; + + $airport->save(); + $ret = 'Added '.$data[0]['name'].'to the database'; + + return $ret; } + public static function addFromDB($icao) { - // lets request the airport identifier from the central database - $client = new Client(); - $res = $client->request('GET', 'http://fsvaos.net/api/central/airports', [ - 'query' => [ - 'icao' => $icao, - ] - ])->getBody(); - // Add the airport to the database - $data = json_decode($res, true); - $airport = new Airport(); - //return dd($data); - try { - $airport->id = $data['airport']['id']; - $airport->name = $data['airport']['name']; - $airport->icao = $data['airport']['gps_code']; - $airport->iata = $data['airport']['iata_code']; - $airport->lat = $data['airport']['latitude_deg']; - $airport->lon = $data['airport']['longitude_deg']; - $airport->city = $data['airport']['municipality']; + // lets request the airport identifier from the central database + $client = new Client(); + $res = $client->request('GET', 'http://fsvaos.net/api/central/airports', [ + 'query' => [ + 'icao' => $icao, + ], + ])->getBody(); + // Add the airport to the database + $data = json_decode($res, true); + $airport = new Airport(); + //return dd($data); + try { + $airport->id = $data['airport']['id']; + $airport->name = $data['airport']['name']; + $airport->icao = $data['airport']['gps_code']; + $airport->iata = $data['airport']['iata_code']; + $airport->lat = $data['airport']['latitude_deg']; + $airport->lon = $data['airport']['longitude_deg']; + $airport->city = $data['airport']['municipality']; $airport->country = $data['airport']['iso_country']; - } - catch (Exception $e) - { - return dd($data); - - } - $airport->save(); + } catch (Exception $e) { + return dd($data); + } + $airport->save(); } + public function addHub(Request $request) { // lets add the hub of an existing airport into the database. diff --git a/app/Http/Controllers/API/AuthAPI.php b/app/Http/Controllers/API/AuthAPI.php index 4a8becd0..4acab169 100644 --- a/app/Http/Controllers/API/AuthAPI.php +++ b/app/Http/Controllers/API/AuthAPI.php @@ -4,47 +4,44 @@ use App\User; use Illuminate\Http\Request; - -use App\Http\Requests; use App\Http\Controllers\Controller; use Illuminate\Support\Facades\Auth; -use Illuminate\Support\Facades\DB; -use Illuminate\Support\Facades\Hash; class AuthAPI extends Controller { /** * Handles Authentication for LEGACY ACARS Clients. + * * @param Request $request + * * @return User * @return string */ public function acarsLogin(Request $request) { if ($request->query('format') == 'email') { - $credentials = array( - 'email' => $request->input('email'), - 'password' => $request->input('password')); + $credentials = [ + 'email' => $request->input('email'), + 'password' => $request->input('password'), ]; } if ($request->query('format') == 'username') { // do some extra work. - $user = User::where('username', $request->input('username'))->first(); - $credentials = array( - 'email' => $user->email, - 'password' => $request->input('password')); + $user = User::where('username', $request->input('username'))->first(); + $credentials = [ + 'email' => $user->email, + 'password' => $request->input('password'), ]; } - if (Auth::validate($credentials)) - { - if ($request->query('format') == 'username') + if (Auth::validate($credentials)) { + if ($request->query('format') == 'username') { $ret = json_encode(['status' => 200, 'user' => User::where('username', $request->input('username'))->first()]); - if ($request->query('format') == 'email') + } + if ($request->query('format') == 'email') { $ret = json_encode(['status' => 200, 'user' => User::where('email', $request->input('email'))->first()]); + } + return $ret; - } - else - { + } else { return json_encode(['status' => 403]); } - } } diff --git a/app/Http/Controllers/API/BidsAPI.php b/app/Http/Controllers/API/BidsAPI.php index b78118de..2738fe93 100644 --- a/app/Http/Controllers/API/BidsAPI.php +++ b/app/Http/Controllers/API/BidsAPI.php @@ -2,64 +2,58 @@ namespace App\Http\Controllers\API; -use App\Models\Flight; -use App\Models\Schedule; -use App\Models\ScheduleComplete; use App\User; use Carbon\Carbon; +use App\Models\Flight; +use App\Models\Airline; +use App\Models\Schedule; use Illuminate\Http\Request; use App\Models\AircraftGroup; -use App\Models\Legacy; -use App\Classes\VAOSHelpers; -use App\Models\Airline; - -use Symfony\Component\Routing\Tests\Fixtures\RedirectableUrlMatcher; +use App\Models\ScheduleComplete; class BidsAPI extends Controller { - public function getBid(Request $request) { // Ok lets find out if we can find the bid $flights = ScheduleComplete::where('user_id', $request->query('userid'))->with('depapt')->with('arrapt')->with('airline')->with('aircraft')->get(); - if ($request->query('format') == "xacars") - { - $user = User::where('username', $request->query('username'))->first(); + if ($request->query('format') == 'xacars') { + $user = User::where('username', $request->query('username'))->first(); $flight = self::getProperFlightNum($request->query('flightnum'), $user->id); return response()->json([ 'status' => 200, - 'bid' => $flight + 'bid' => $flight, ]); } - if ($flights === null) - { + if ($flights === null) { // We didn't find shit for that user. Return a 404 return json_encode([ - 'status' => 404 + 'status' => 404, ]); } // Ok now lets do a general query return response()->json([ - 'status' => 200, - 'flights' => $flights + 'status' => 200, + 'flights' => $flights, ]); } + public function fileBid(Request $request) { $template = Schedule::where('id', $request->input('schedule_id'))->with('depapt')->with('arrapt')->with('airline')->with('aircraft_group')->first(); //$template = Schedule::where('id', $request->query('schedule_id'))->first(); // Now let's turn the aircraft group into a assigned aircraft. // Let's start by getting the group's assigned aircraft list. - if ($template->aircraft_group_id != null) + if ($template->aircraft_group_id != null) { $acfgrp = AircraftGroup::where('id', $template->aircraft_group->id)->with('aircraft')->first(); - else + } else { $acfgrp = AircraftGroup::with('aircraft')->first(); + } // ok lets assign the first aircraft on the list // TODO Change aircraft selection behavior. Current: First on list - $complete = new ScheduleComplete(); // First let's bring all the foreign keys from the previous table into this one. @@ -75,9 +69,9 @@ public function fileBid(Request $request) $defaults = json_decode($template->defaults); $complete->flightnum = $template->flightnum; - $complete->route = $defaults['route']; + $complete->route = $defaults['route']; // Now lets encode the cruise altitude in the JSON - $rte_data = array(); + $rte_data = []; $rte_data['cruise'] = $defaults['cruise']; // store it @@ -86,26 +80,30 @@ public function fileBid(Request $request) $complete->deptime = Carbon::now(); $complete->arrtime = Carbon::now(); - $complete->load = 0; + $complete->load = 0; $complete->save(); - - return response()->json([ - 'status' => 200 + 'status' => 200, ]); } + public function view($id) { $flight = Flight::with('user')->with('airline')->with('depapt')->with('arrapt')->with('aircraft')->find($id); + return response()->json($flight); } - private static function getProperFlightNum($flightnum, $userid) { - if ($flightnum == '') return false; - $ret = array(); + private static function getProperFlightNum($flightnum, $userid) + { + if ($flightnum == '') { + return false; + } + + $ret = []; $flightnum = strtoupper($flightnum); - $airlines = Airline::all(); + $airlines = Airline::all(); foreach ($airlines as $a) { $a->icao = strtoupper($a->icao); @@ -114,7 +112,7 @@ private static function getProperFlightNum($flightnum, $userid) { continue; } - $ret['icao'] = $a->icao; + $ret['icao'] = $a->icao; $ret['flightnum'] = str_ireplace($a->icao, '', $flightnum); // ok now that we deduced that, let's find the bid. @@ -122,9 +120,10 @@ private static function getProperFlightNum($flightnum, $userid) { return Flight::where(['user_id' => $userid, 'airline_id' => $a->id, 'flightnum' => $ret['flightnum']])->with('depapt')->with('arrapt')->with('airline')->with('aircraft')->first(); } - # Invalid flight number - $ret['code'] = ''; + // Invalid flight number + $ret['code'] = ''; $ret['flightnum'] = $flightnum; + return Flight::where(['user_id' => $userid, 'flightnum' => $ret['flightnum']])->with('depapt')->with('arrapt')->with('airline')->with('aircraft')->first(); } } diff --git a/app/Http/Controllers/API/CodeshareAPI.php b/app/Http/Controllers/API/CodeshareAPI.php index 7c3af0c0..014c40d9 100644 --- a/app/Http/Controllers/API/CodeshareAPI.php +++ b/app/Http/Controllers/API/CodeshareAPI.php @@ -2,14 +2,9 @@ namespace App\Http\Controllers\API; -use Illuminate\Http\Request; - -use App\Http\Requests; - class CodeshareAPI extends Controller { public function GetSchedule() { - } } diff --git a/app/Http/Controllers/API/FleetAPI.php b/app/Http/Controllers/API/FleetAPI.php index 12e2c00b..7ec703ae 100644 --- a/app/Http/Controllers/API/FleetAPI.php +++ b/app/Http/Controllers/API/FleetAPI.php @@ -2,89 +2,82 @@ namespace App\Http\Controllers\API; -use App\Classes\VAOS_Aircraft; -use App\AircraftGroup; use App\Airline; -use App\Models\Aircraft; -use App\Models\Airport; +use App\AircraftGroup; use GuzzleHttp\Client; +use App\Models\Airport; +use App\Models\Aircraft; use Illuminate\Http\Request; -use App\Http\Requests; - class FleetAPI extends Controller { public function showAll() { return json_encode(['status' => 200, 'aircraft' => Aircraft::all()]); } + public function addAircraft(Request $request) { // POST http://airline.com/api/1_0/fleet // First lets check to see if we are adding via local provided data or from Central's database - if ($request->query('source') == 'local') - { + if ($request->query('source') == 'local') { // This route is to add an aircraft providing ALL local values. This will be fun!!! // lets steralize the array before sending it to the class. Things can get messy - $data = array(); - $data['icao'] = $request->input('icao'); - $data['name'] = $request->input('name'); + $data = []; + $data['icao'] = $request->input('icao'); + $data['name'] = $request->input('name'); $data['manufacturer'] = $request->input('manufacturer'); $data['registration'] = $request->input('registration'); - $data['range'] = $request->input('range'); - $data['maxpax'] = $request->input('maxpax'); - $data['maxgw'] = $request->input('maxgw'); - $data['enabled'] = $request->input('enabled'); - $data['hub'] = $request->input('hub'); - $data['airline'] = $request->input('airline'); - $data['group'] = $request->input('group'); - //dd(AircraftGroup::where(['icao' => $data['icao'], 'userdefined' => false ])->first()); + $data['range'] = $request->input('range'); + $data['maxpax'] = $request->input('maxpax'); + $data['maxgw'] = $request->input('maxgw'); + $data['enabled'] = $request->input('enabled'); + $data['hub'] = $request->input('hub'); + $data['airline'] = $request->input('airline'); + $data['group'] = $request->input('group'); + //dd(AircraftGroup::where(['icao' => $data['icao'], 'userdefined' => false ])->first()); // $result = AircraftData::createAircraft($data); - } - else - { + } else { // Lets Call Home to retrieve our data. Much easier!! $client = new Client(); $res = $client->request('GET', 'http://fsvaos.net/api/central/aircraft', [ 'query' => [ 'icao' => $request->input('icao'), - ] + ], ])->getBody(); - if ($res['status'] == 404) - { + if ($res['status'] == 404) { // well the main server is a useless piece of shit so lets inform the user that. return response()->json([ - 'status' => 501 + 'status' => 501, ]); } // lets steralize the array before sending it to the class. Things can get messy - $data = array(); - $data['icao'] = $res['aircraft']['icao']; - $data['name'] = $res['aircraft']['name']; + $data = []; + $data['icao'] = $res['aircraft']['icao']; + $data['name'] = $res['aircraft']['name']; $data['manufacturer'] = $res['aircraft']['manufacturer']; $data['registration'] = $request->input('registration'); - $data['range'] = $res['aircraft']['range']; - $data['maxpax'] = $res['aircraft']['maxpax']; - $data['maxgw'] = $res['aircraft']['maxgw']; - $data['enabled'] = $request->input('enabled'); - + $data['range'] = $res['aircraft']['range']; + $data['maxpax'] = $res['aircraft']['maxpax']; + $data['maxgw'] = $res['aircraft']['maxgw']; + $data['enabled'] = $request->input('enabled'); // $result = AircraftData::createAircraft($data); } $acf = new Aircraft(); - $acf->icao = $data['icao']; - $acf->name = $data['name']; + $acf->icao = $data['icao']; + $acf->name = $data['name']; $acf->manufacturer = $data['manufacturer']; $acf->registration = $data['registration']; - $acf->range = $data['range']; - $acf->maxpax = $data['maxpax']; - $acf->maxgw = $data['maxgw']; - $acf->enabled = $data['enabled']; + $acf->range = $data['range']; + $acf->maxpax = $data['maxpax']; + $acf->maxgw = $data['maxgw']; + $acf->enabled = $data['enabled']; // time for the optional stuff @@ -111,33 +104,29 @@ public function addAircraft(Request $request) // Aircraft Groups are both User Defined and System Defined. // First, we want to check if there is an aircraft group that already exists for this type. - $sysgrp = AircraftGroup::where(['icao' => $data['icao'], 'userdefined' => false ])->first(); + $sysgrp = AircraftGroup::where(['icao' => $data['icao'], 'userdefined' => false])->first(); - if ($sysgrp === null ) - { + if ($sysgrp === null) { // We didn't find it so lets create one real quick $group = new AircraftGroup([ - 'name' => $data['name'], - 'icao' => $data['icao'], - 'userdefined' => false + 'name' => $data['name'], + 'icao' => $data['icao'], + 'userdefined' => false, ]); // now lets associate the aircraft with the new group. $group->save(); $acf->aircraft_group()->attach($group); - } - else - { + } else { // ok now that we know that the group exists, lets add it to the already existing system group. $acf->aircraft_group()->attach($sysgrp); } // Now that is done, lets check if we want to add it to a user defined group. - if ($data['group'] != null) - { + if ($data['group'] != null) { $acf->aircraft_group()->attach($data['group']); } return response()->json([ - 'status' => 200 + 'status' => 200, ]); } } diff --git a/app/Http/Controllers/API/PIREPAPI.php b/app/Http/Controllers/API/PIREPAPI.php index 9e627e86..ed670c54 100644 --- a/app/Http/Controllers/API/PIREPAPI.php +++ b/app/Http/Controllers/API/PIREPAPI.php @@ -2,27 +2,25 @@ namespace App\Http\Controllers\API; -use App\Classes\phpVMSLegacy; -use App\Models\LogbookEntry as PIREP; -use App\Models\LogbookComment as PIREPComment; use App\User; -use App\Models\Airline; use App\Models\Flight; +use App\Models\Airline; use Illuminate\Http\Request; - -use App\Http\Requests; +use App\Models\LogbookEntry as PIREP; +use App\Models\LogbookComment as PIREPComment; class PIREPAPI extends Controller { /** * File a PIREP into the system. + * * @param Request $request */ public function filePIREP(Request $request) { // first lets check to see if we have everything required for the request $input = $request->all(); - $data = array(); + $data = []; // First lets update financial data. @@ -35,9 +33,7 @@ public function filePIREP(Request $request) // first let's retrieve the original bid from the database and enter in all the values - - if ($request->query('format') == 'phpVMS') - { + if ($request->query('format') == 'phpVMS') { $pirep->user()->associate($request->input('pilotid')); // This is a legacy ACARS client. Treat it with respect, they won't be around // for too much longer. All we need is the user data, flight info and we are all set @@ -48,18 +44,20 @@ public function filePIREP(Request $request) $pirep->aircraft()->associate($flightinfo->aircraft_id); $pirep->depapt()->associate($flightinfo->depapt_id); $pirep->arrapt()->associate($flightinfo->arrapt_id); - $pirep->flightnum = $flightinfo->flightnum; - $pirep->route = "NOT SUPPORTED"; - $pirep->status = 0; + $pirep->flightnum = $flightinfo->flightnum; + $pirep->route = 'NOT SUPPORTED'; + $pirep->status = 0; $pirep->landingrate = $request->input('landingrate'); // Auto Accept System if (env('VAOS_AA_ENABLED')) { - if ($request->input('landingrate') >= env('VAOS_AA_LR')) + if ($request->input('landingrate') >= env('VAOS_AA_LR')) { $pirep->status = 1; + } } - if (env('VAOS_AA_ALL')) + if (env('VAOS_AA_ALL')) { $pirep->status = 1; + } $pirep->save(); // now let's take care of comments. @@ -75,16 +73,20 @@ public function filePIREP(Request $request) $flightinfo->delete(); return response()->json([ - 'status' => 200 + 'status' => 200, ]); } } - private static function getProperFlightNum($flightnum, $userid) { - if ($flightnum == '') return false; - $ret = array(); + private static function getProperFlightNum($flightnum, $userid) + { + if ($flightnum == '') { + return false; + } + + $ret = []; $flightnum = strtoupper($flightnum); - $airlines = Airline::all(); + $airlines = Airline::all(); foreach ($airlines as $a) { $a->icao = strtoupper($a->icao); @@ -93,7 +95,7 @@ private static function getProperFlightNum($flightnum, $userid) { continue; } - $ret['icao'] = $a->icao; + $ret['icao'] = $a->icao; $ret['flightnum'] = str_ireplace($a->icao, '', $flightnum); // ok now that we deduced that, let's find the bid. @@ -101,11 +103,13 @@ private static function getProperFlightNum($flightnum, $userid) { return Flight::where(['user_id' => $userid, 'airline_id' => $a->id, 'flightnum' => $ret['flightnum']])->with('depapt')->with('arrapt')->with('airline')->with('aircraft')->first(); } - # Invalid flight number - $ret['code'] = ''; + // Invalid flight number + $ret['code'] = ''; $ret['flightnum'] = $flightnum; + return Flight::where(['user_id' => $userid, 'flightnum' => $ret['flightnum']])->with('depapt')->with('arrapt')->with('airline')->with('aircraft')->first(); } + public function getFlight($id) { $flight = PIREP::where('id', $id)->with('airline')->with('depapt')->with('arrapt')->with('aircraft')->with('acarsdata')->first(); diff --git a/app/Http/Controllers/API/ScheduleAPI.php b/app/Http/Controllers/API/ScheduleAPI.php index 8d01e8ca..d8e2f536 100644 --- a/app/Http/Controllers/API/ScheduleAPI.php +++ b/app/Http/Controllers/API/ScheduleAPI.php @@ -1,36 +1,30 @@ input('codeshare') == true) - { - - } - else { - + if ($request->input('codeshare') == true) { + } else { $schedule = ScheduleTemplate::with('depapt')->with('arrapt')->with('airline')->with('aircraft_group')->get(); + return response()->json([ - 'status' => 200, - 'schedule' => $schedule + 'status' => 200, + 'schedule' => $schedule, ]); } } @@ -41,111 +35,102 @@ public function index(Request $request) public function get(Request $request) { // find out if this is calling the ID or the airport identifier - if ($request->has('depicao')) - { + if ($request->has('depicao')) { $route = ScheduleTemplate::where('depicao', $request->depicao)->get(); } - if ($request->has('arricao')) - { - $route = ScheduleTemplate::where('arricao', $request->arricao)->get(); + if ($request->has('arricao')) { + $route = ScheduleTemplate::where('arricao', $request->arricao)->get(); } - if ($request->has('id')) - { + if ($request->has('id')) { $route = ScheduleTemplate::find($request->id); } + return json_encode(['status' => 200, - 'schedule' => $route]); + 'schedule' => $route, ]); } + /** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request + * * @return \Illuminate\Http\Response */ public function add(Request $request) { - // Declare a new instance of the Schedule Model - $entry = new ScheduleTemplate(); - - // Before we add the route, lets check to see if the airport exists. - if (Airport::where('icao', $request->input('depicao'))->first() === null) - { - VAOS_Airports::AddAirport($request->input('depicao')); - } - if (Airport::where('icao', $request->input('arricao'))->first() === null) - { + // Declare a new instance of the Schedule Model + $entry = new ScheduleTemplate(); + + // Before we add the route, lets check to see if the airport exists. + if (Airport::where('icao', $request->input('depicao'))->first() === null) { + VAOS_Airports::AddAirport($request->input('depicao')); + } + if (Airport::where('icao', $request->input('arricao'))->first() === null) { VAOS_Airports::AddAirport($request->input('arricao')); - } - // add the form elements + } + // add the form elements // Search for the airline in the database - - $entry->flightnum = $request->input('flightnum'); + $entry->flightnum = $request->input('flightnum'); // Setup the foreign keys. Lets now find the new airports $dep = Airport::where('icao', $request->input('depicao'))->first(); $arr = Airport::where('icao', $request->input('arricao'))->first(); - $entry->depapt()->associate($dep); - $entry->arrapt()->associate($arr); + $entry->depapt()->associate($dep); + $entry->arrapt()->associate($arr); $airline = Airline::where('icao', $request->input('code'))->first(); $entry->airline()->associate($airline); - if ($request->has('alticao')) - { - $entry->alticao = $request->input('alticao'); - } - if ($request->has('route')) - { - $entry->route = $request->input('route'); - } - if ($request->has('aircraft_group')) - { - $acfgrp = AircraftGroup::where('icao', $request->input('aircraft_group'))->first(); - $entry->aircraft_group()->associate($acfgrp); - } - $entry->seasonal = true; - //$entry->daysofweek = "0123456"; - $entry->type = $request->input('type'); - if ($request->has('enabled')) - { - $entry->enabled = $request->input('enabled'); - } - else - { - $entry->enabled = 1; - } - $entry->save(); - - + if ($request->has('alticao')) { + $entry->alticao = $request->input('alticao'); + } + if ($request->has('route')) { + $entry->route = $request->input('route'); + } + if ($request->has('aircraft_group')) { + $acfgrp = AircraftGroup::where('icao', $request->input('aircraft_group'))->first(); + $entry->aircraft_group()->associate($acfgrp); + } + $entry->seasonal = true; + //$entry->daysofweek = "0123456"; + $entry->type = $request->input('type'); + if ($request->has('enabled')) { + $entry->enabled = $request->input('enabled'); + } else { + $entry->enabled = 1; + } + $entry->save(); } + /** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param int $id + * * @return \Illuminate\Http\Response */ public function update(Request $request, $id) { - } + public function jsonadd(Request $request) { $data = json_decode($request->getContent(), true); - foreach ($data as $d) - { + foreach ($data as $d) { VAOS_Schedule::newRoute([ - 'depicao' => $d['depicao'], - 'arricao' => $d['arricao'], - 'airline' => $d['airline'], - 'flightnum' => $d['flightnum'], + 'depicao' => $d['depicao'], + 'arricao' => $d['arricao'], + 'airline' => $d['airline'], + 'flightnum' => $d['flightnum'], 'aircraft_group' => $d['aircraft_group'], - 'enabled' => $d['enabled'] + 'enabled' => $d['enabled'], ]); } + return response()->json([ - 'status' => 200 + 'status' => 200, ]); } @@ -153,14 +138,15 @@ public function jsonadd(Request $request) * Remove the specified resource from storage. * * @param int $id + * * @return \Illuminate\Http\Response */ public function delete($id) { // } + public function test(Request $request) { - } } diff --git a/app/Http/Controllers/API/UsersAPI.php b/app/Http/Controllers/API/UsersAPI.php index ab28e56d..b3a15f47 100644 --- a/app/Http/Controllers/API/UsersAPI.php +++ b/app/Http/Controllers/API/UsersAPI.php @@ -11,8 +11,7 @@ class UsersAPI extends Controller public function getUsers(Request $request) { // Very simple API. Just return the user with the name. - if ($request->query('username')) - { + if ($request->query('username')) { return User::where('username', $request->query('username'))->first(); } } diff --git a/app/Http/Controllers/Admin/AdminController.php b/app/Http/Controllers/Admin/AdminController.php index b9b945b8..a53e0013 100644 --- a/app/Http/Controllers/Admin/AdminController.php +++ b/app/Http/Controllers/Admin/AdminController.php @@ -2,10 +2,6 @@ namespace App\Http\Controllers\Admin; -use App\ScheduleTemplate; -use Illuminate\Http\Request; - -use App\Http\Requests; use App\Http\Controllers\Controller; class AdminController extends Controller diff --git a/app/Http/Controllers/Admin/AirlineController.php b/app/Http/Controllers/Admin/AirlineController.php index 39e04d4c..32c4bed9 100644 --- a/app/Http/Controllers/Admin/AirlineController.php +++ b/app/Http/Controllers/Admin/AirlineController.php @@ -18,8 +18,10 @@ public function index() // Return the list of airlines $airlines = Airline::all(); - if ($airlines->count() == 0) + if ($airlines->count() == 0) { return redirect('/admin/airlines/create'); + } + return view('admin.airline.view', ['airlines' => $airlines]); } @@ -37,6 +39,7 @@ public function create() * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request + * * @return \Illuminate\Http\Response */ public function store(Request $request) @@ -45,17 +48,21 @@ public function store(Request $request) $airline->name = $request->input('name'); $airline->icao = $request->input('icao'); - if ($request->input('iata') != null) + if ($request->input('iata') != null) { $airline->iata = $request->input('iata'); + } $airline->callsign = $request->input('callsign'); - if ($request->input('logo') != null) + if ($request->input('logo') != null) { $airline->logo = $request->input('logo'); - if ($request->input('widget') != null) + } + if ($request->input('widget') != null) { $airline->widget = $request->input('widget'); + } $airline->save(); $request->session()->flash('airline_created', true); + return redirect('/admin/airlines'); } @@ -63,6 +70,7 @@ public function store(Request $request) * Display the specified resource. * * @param int $id + * * @return \Illuminate\Http\Response */ public function show($id) @@ -74,6 +82,7 @@ public function show($id) * Show the form for editing the specified resource. * * @param int $id + * * @return \Illuminate\Http\Response */ public function edit($id) @@ -88,6 +97,7 @@ public function edit($id) * * @param \Illuminate\Http\Request $request * @param int $id + * * @return \Illuminate\Http\Response */ public function update(Request $request, $id) @@ -96,17 +106,21 @@ public function update(Request $request, $id) $airline->name = $request->input('name'); $airline->icao = $request->input('icao'); - if ($request->input('iata') != null) + if ($request->input('iata') != null) { $airline->iata = $request->input('iata'); + } $airline->callsign = $request->input('callsign'); - if ($request->input('logo') != null) + if ($request->input('logo') != null) { $airline->logo = $request->input('logo'); - if ($request->input('widget') != null) + } + if ($request->input('widget') != null) { $airline->widget = $request->input('widget'); + } $airline->save(); $request->session()->flash('updated', true); + return redirect('/admin/airlines'); } @@ -114,14 +128,15 @@ public function update(Request $request, $id) * Remove the specified resource from storage. * * @param int $id + * * @return \Illuminate\Http\Response */ public function destroy($id) { // } + public function addHub(Request $request) { - } } diff --git a/app/Http/Controllers/Admin/AirportController.php b/app/Http/Controllers/Admin/AirportController.php index b931370e..5d4b7cd2 100644 --- a/app/Http/Controllers/Admin/AirportController.php +++ b/app/Http/Controllers/Admin/AirportController.php @@ -3,8 +3,6 @@ namespace App\Http\Controllers\Admin; use Illuminate\Http\Request; - -use App\Http\Requests; use App\Http\Controllers\Controller; class AirportController extends Controller @@ -33,6 +31,7 @@ public function create() * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request + * * @return \Illuminate\Http\Response */ public function store(Request $request) @@ -44,6 +43,7 @@ public function store(Request $request) * Display the specified resource. * * @param int $id + * * @return \Illuminate\Http\Response */ public function show($id) @@ -55,6 +55,7 @@ public function show($id) * Show the form for editing the specified resource. * * @param int $id + * * @return \Illuminate\Http\Response */ public function edit($id) @@ -67,6 +68,7 @@ public function edit($id) * * @param \Illuminate\Http\Request $request * @param int $id + * * @return \Illuminate\Http\Response */ public function update(Request $request, $id) @@ -78,6 +80,7 @@ public function update(Request $request, $id) * Remove the specified resource from storage. * * @param int $id + * * @return \Illuminate\Http\Response */ public function destroy($id) diff --git a/app/Http/Controllers/Admin/BidsController.php b/app/Http/Controllers/Admin/BidsController.php index e2448d0f..38c39f03 100644 --- a/app/Http/Controllers/Admin/BidsController.php +++ b/app/Http/Controllers/Admin/BidsController.php @@ -31,6 +31,7 @@ public function create() * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request + * * @return \Illuminate\Http\Response */ public function store(Request $request) @@ -42,6 +43,7 @@ public function store(Request $request) * Display the specified resource. * * @param int $id + * * @return \Illuminate\Http\Response */ public function show($id) @@ -53,6 +55,7 @@ public function show($id) * Show the form for editing the specified resource. * * @param int $id + * * @return \Illuminate\Http\Response */ public function edit($id) @@ -65,6 +68,7 @@ public function edit($id) * * @param \Illuminate\Http\Request $request * @param int $id + * * @return \Illuminate\Http\Response */ public function update(Request $request, $id) @@ -76,6 +80,7 @@ public function update(Request $request, $id) * Remove the specified resource from storage. * * @param int $id + * * @return \Illuminate\Http\Response */ public function destroy($id) diff --git a/app/Http/Controllers/Admin/FleetController.php b/app/Http/Controllers/Admin/FleetController.php index f8f1a0b1..4b10011c 100644 --- a/app/Http/Controllers/Admin/FleetController.php +++ b/app/Http/Controllers/Admin/FleetController.php @@ -2,12 +2,11 @@ namespace App\Http\Controllers\Admin; -use App\Classes\VAOS_Aircraft; +use App\Models\Airline; use App\Models\Aircraft; use Illuminate\Http\Request; -use App\Models\Airline; use App\Models\AircraftGroup; -use App\Http\Requests; +use App\Classes\VAOS_Aircraft; use App\Http\Controllers\Controller; class FleetController extends Controller @@ -31,8 +30,9 @@ public function index() */ public function create() { - $airlines = Airline::all(); + $airlines = Airline::all(); $acfgroups = AircraftGroup::where('userdefined', true)->get(); + return view('admin.fleet.create', ['airlines' => $airlines, 'acfgroups' => $acfgroups]); } @@ -40,29 +40,32 @@ public function create() * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request + * * @return \Illuminate\Http\Response */ public function store(Request $request) { - $data = array(); - $data['icao'] = $request->input('icao'); - $data['name'] = $request->input('name'); + $data = []; + $data['icao'] = $request->input('icao'); + $data['name'] = $request->input('name'); $data['manufacturer'] = $request->input('manufacturer'); $data['registration'] = $request->input('registration'); - $data['range'] = $request->input('range'); - $data['maxpax'] = $request->input('maxpax'); - $data['maxgw'] = $request->input('maxgw'); - if ($request->input('status') == 1) + $data['range'] = $request->input('range'); + $data['maxpax'] = $request->input('maxpax'); + $data['maxgw'] = $request->input('maxgw'); + if ($request->input('status') == 1) { $data['status'] = $request->input('status'); - else + } else { $data['status'] = 0; + } $data['airline'] = $request->input('airline'); - $data['hub'] = null; - $data['group'] = null; + $data['hub'] = null; + $data['group'] = null; //dd($data); if (VAOS_Aircraft::createAircraft($data)) { $request->session()->flash('aircraft_created', true); + return redirect('admin/fleet'); } else { dd($data); @@ -73,6 +76,7 @@ public function store(Request $request) * Display the specified resource. * * @param int $id + * * @return \Illuminate\Http\Response */ public function show($id) @@ -84,14 +88,16 @@ public function show($id) * Show the form for editing the specified resource. * * @param int $id + * * @return \Illuminate\Http\Response */ public function edit($id) { $aircraft = Aircraft::findOrFail($id); - $airlines = Airline::all(); + $airlines = Airline::all(); $acfgroups = AircraftGroup::where('userdefined', true)->get(); + return view('admin.fleet.edit', ['aircraft' => $aircraft, 'airlines' => $airlines, 'acfgroups' => $acfgroups]); } @@ -100,30 +106,33 @@ public function edit($id) * * @param \Illuminate\Http\Request $request * @param int $id + * * @return \Illuminate\Http\Response */ public function update(Request $request, $id) { - $data = array(); - $data['icao'] = $request->input('icao'); - $data['name'] = $request->input('name'); + $data = []; + $data['icao'] = $request->input('icao'); + $data['name'] = $request->input('name'); $data['manufacturer'] = $request->input('manufacturer'); $data['registration'] = $request->input('registration'); - $data['range'] = $request->input('range'); - $data['maxpax'] = $request->input('maxpax'); - $data['maxgw'] = $request->input('maxgw'); + $data['range'] = $request->input('range'); + $data['maxpax'] = $request->input('maxpax'); + $data['maxgw'] = $request->input('maxgw'); - if ($request->input('status') == 1) + if ($request->input('status') == 1) { $data['status'] = $request->input('status'); - else + } else { $data['status'] = 0; + } $data['airline'] = $request->input('airline'); - $data['hub'] = null; - $data['group'] = null; + $data['hub'] = null; + $data['group'] = null; //dd($data); if (VAOS_Aircraft::updateAircraft($data, $id)) { $request->session()->flash('aircraft_updated', true); + return redirect('admin/fleet'); } else { dd($data); @@ -134,6 +143,7 @@ public function update(Request $request, $id) * Remove the specified resource from storage. * * @param int $id + * * @return \Illuminate\Http\Response */ public function destroy($id) diff --git a/app/Http/Controllers/Admin/ImportExportController.php b/app/Http/Controllers/Admin/ImportExportController.php index cfe78be3..c35b961e 100644 --- a/app/Http/Controllers/Admin/ImportExportController.php +++ b/app/Http/Controllers/Admin/ImportExportController.php @@ -2,32 +2,30 @@ namespace App\Http\Controllers\Admin; -use App\Models\AircraftGroup; use App\Models\Airline; -use App\Classes\VAOS_Aircraft as AircraftData; -use App\Classes\VAOS_Schedule; use App\Models\JobProgress; use Illuminate\Http\Request; -use Illuminate\Support\Facades\Storage; +use App\Classes\VAOS_Schedule; use App\Http\Controllers\Controller; use Maatwebsite\Excel\Facades\Excel; +use Illuminate\Support\Facades\Storage; +use App\Classes\VAOS_Aircraft as AircraftData; class ImportExportController extends Controller { public function getSystem(Request $request) { - } + public function postSystem(Request $request) { - if ($request->query('task') == 'import') - { + if ($request->query('task') == 'import') { $progress = new JobProgress([ - 'task' => 'import', - 'slug' => 'Import VAOS System', - 'description' => 'Uploading Workbook', - 'totalitems' => 1, - 'itemscompleted' => 0 + 'task' => 'import', + 'slug' => 'Import VAOS System', + 'description' => 'Uploading Workbook', + 'totalitems' => 1, + 'itemscompleted' => 0, ]); // Import the File to the file system @@ -35,27 +33,28 @@ public function postSystem(Request $request) // Load the Excel Import Object Excel::load($path, function ($reader) { - }); - } } + public function getAirlines(Request $request) { $path = $request->file('file')->store('data'); } + public function PostAirlines(Request $request) { $path = $request->file('file')->store('data'); } + public function getFleet(Request $request) { - return view('admin.data.import',['route' => 'fleet']); + return view('admin.data.import', ['route' => 'fleet']); } + public function postFleet(Request $request) { - if ($request->query('action') == 'import') - { + if ($request->query('action') == 'import') { /* $progress = new JobProgress([ 'task' => 'import', @@ -73,20 +72,19 @@ public function postFleet(Request $request) $data = json_decode(Storage::get($path), true); - foreach ($data as $row) - { + foreach ($data as $row) { //$airline_id = Airline::where('icao', $row['airline'])->first(); //$row['airline'] = $airline_id->id; $data = [ - 'airline' => $row['airline'], - 'icao' => $row['icao'], - 'name' => $row['name'], + 'airline' => $row['airline'], + 'icao' => $row['icao'], + 'name' => $row['name'], 'manufacturer' => $row['manufacturer'], 'registration' => $row['registration'], - 'range' => $row['range'], - 'maxgw' => $row['maxgw'], - 'maxpax' => $row['maxpax'], - 'status' => $row['status'] + 'range' => $row['range'], + 'maxgw' => $row['maxgw'], + 'maxpax' => $row['maxpax'], + 'status' => $row['status'], ]; AircraftData::createAircraft($data); } @@ -96,35 +94,34 @@ public function postFleet(Request $request) return redirect('/admin/fleet'); } } + public function getSchedule(Request $request) { - return view('admin.data.import',['route' => 'schedule']); + return view('admin.data.import', ['route' => 'schedule']); } + public function postSchedule(Request $request) { - if ($request->query('action') == 'import') - { - + if ($request->query('action') == 'import') { $path = $request->file('file')->storeAS('imports', 'schedule.json'); //dd($path); // Load the Excel Import Object $data = json_decode(Storage::get($path), true); - foreach ($data as $d) - { + foreach ($data as $d) { $route = [ - 'depicao' => $d['depicao'], - 'arricao' => $d['arricao'], - 'airline' => $d['airline'], - 'flightnum' => $d['flightnum'], + 'depicao' => $d['depicao'], + 'arricao' => $d['arricao'], + 'airline' => $d['airline'], + 'flightnum' => $d['flightnum'], 'aircraft_group' => $d['aircraft_group'], - 'type' => $d['type'], - 'enabled' => $d['enabled'] + 'type' => $d['type'], + 'enabled' => $d['enabled'], ]; VAOS_Schedule::newRoute($route); } $request->session()->flash('success', 'Routes imported successfully.'); - + return redirect('/admin/schedule'); } } diff --git a/app/Http/Controllers/Admin/InstallController.php b/app/Http/Controllers/Admin/InstallController.php index 03ccc321..51f93691 100644 --- a/app/Http/Controllers/Admin/InstallController.php +++ b/app/Http/Controllers/Admin/InstallController.php @@ -2,163 +2,162 @@ namespace App\Http\Controllers\Admin; +use App\User; use App\Classes\OTF_DB; use Illuminate\Http\Request; +use Illuminate\Support\Facades\DB; use App\Http\Controllers\Controller; +use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Schema; use Illuminate\Support\Facades\Artisan; -use Illuminate\Support\Facades\Auth; -use Illuminate\Support\Facades\DB; -use App\User; -use Illuminate\Support\Facades\Session; - - -class InstallController extends Controller { - public function index(Request $request) { - if (env('VAOS_Setup') != TRUE) { - // Return the view right now - if ($request->query('mode') == "fresh") { - return view('install.fresh'); - } - elseif ($request->query('mode') == "settings") { - $data = $_ENV; - return view('install.settings')->with('data', $data); - } - else { - return view('install.welcome'); - } - } - else { - return redirect('/'); - } - } +class InstallController extends Controller +{ + public function index(Request $request) + { + if (env('VAOS_Setup') != true) { + // Return the view right now + if ($request->query('mode') == 'fresh') { + return view('install.fresh'); + } elseif ($request->query('mode') == 'settings') { + $data = $_ENV; + + return view('install.settings')->with('data', $data); + } else { + return view('install.welcome'); + } + } else { + return redirect('/'); + } + } - public function doInstall(Request $request) { - if (!Schema::hasTable('users')) { - Artisan::call('key:generate'); - // Run the database migration - Artisan::call('migrate'); - User::create([ + public function doInstall(Request $request) + { + if (! Schema::hasTable('users')) { + Artisan::call('key:generate'); + // Run the database migration + Artisan::call('migrate'); + User::create([ 'first_name' => $request->input('first_name'), - 'last_name' => $request->input('last_name'), - 'email' => $request->input('email'), - 'password' => bcrypt($request->input('password')), - 'username' => $request->input('username'), - 'status' => 1, - 'admin' => TRUE + 'last_name' => $request->input('last_name'), + 'email' => $request->input('email'), + 'password' => bcrypt($request->input('password')), + 'username' => $request->input('username'), + 'status' => 1, + 'admin' => true, ]); - $this->changeEnvironmentVariable('VAOS_Setup', TRUE); + $this->changeEnvironmentVariable('VAOS_Setup', true); - #Removed in the view for the moment - /*if (App::environment('production')) { - Artisan::call('config:cache'); - }else{ - $this->changeEnvironmentVariable('APP_DEBUG', TRUE); - }*/ + //Removed in the view for the moment + /*if (App::environment('production')) { + Artisan::call('config:cache'); + }else{ + $this->changeEnvironmentVariable('APP_DEBUG', TRUE); + }*/ - $user = User::find(1); - Auth::login($user); + $user = User::find(1); + Auth::login($user); - return redirect('/admin'); - } - else { - return redirect('/'); + return redirect('/admin'); + } else { + return redirect('/'); + } } - } - - public function settings(Request $request) { - $data = $request->all(); - - foreach ($data as $key => $value) { - if ($key != '_token') { - if ($key == "VAOS_ORG_NAME" || $key == "VAOS_ORG_EMAIL") { - $this->changeEnvironmentVariableSpecial($key, $value); - /*} - #Removed in the view for the moment - elseif ($key == "APP_ENV_Development" || $key == "APP_ENV_Production") { - if ($key == "APP_ENV_Development"){ - $value = 'local'; - - }else{ - $value = 'production'; + public function settings(Request $request) + { + $data = $request->all(); + + foreach ($data as $key => $value) { + if ($key != '_token') { + if ($key == 'VAOS_ORG_NAME' || $key == 'VAOS_ORG_EMAIL') { + $this->changeEnvironmentVariableSpecial($key, $value); + /*} + #Removed in the view for the moment + elseif ($key == "APP_ENV_Development" || $key == "APP_ENV_Production") { + if ($key == "APP_ENV_Development"){ + $value = 'local'; + + }else{ + $value = 'production'; + } + $this->changeEnvironmentVariable('APP_ENV', $value);*/ + } else { + $this->changeEnvironmentVariable($key, $value); + } } - $this->changeEnvironmentVariable('APP_ENV', $value);*/ - }else{ - $this->changeEnvironmentVariable($key, $value); } - } - } - return redirect('/setup?mode=fresh'); - - } - - public function changeEnvironmentVariable($key, $value) { - $path = base_path('.env'); - - if (is_bool(env($key))) { - $old = env($key) ? 'true' : 'false'; - $value = $value ? 'true' : 'false'; - } - else { - $old = env($key); + return redirect('/setup?mode=fresh'); } + public function changeEnvironmentVariable($key, $value) + { + $path = base_path('.env'); + if (is_bool(env($key))) { + $old = env($key) ? 'true' : 'false'; + $value = $value ? 'true' : 'false'; + } else { + $old = env($key); + } - if (file_exists($path)) { - file_put_contents($path, str_replace( - $key . "=" . $old, $key . "=" . $value, file_get_contents($path) + if (file_exists($path)) { + file_put_contents($path, str_replace( + $key.'='.$old, $key.'='.$value, file_get_contents($path) )); - + } } - } - public function changeEnvironmentVariableSpecial($key, $value) { - $path = base_path('.env'); + public function changeEnvironmentVariableSpecial($key, $value) + { + $path = base_path('.env'); - $old = env($key); + $old = env($key); - if (file_exists($path)) { - file_put_contents($path, str_replace( - $key . "=" . '"' . $old . '"', $key . "=" . '"' . $value . '"', + if (file_exists($path)) { + file_put_contents($path, str_replace( + $key.'='.'"'.$old.'"', $key.'='.'"'.$value.'"', file_get_contents($path) )); + } } - } - - public function phpVMSTransfer(Request $request) { - // Set the database - $oldDB = new OTF_DB([ + public function phpVMSTransfer(Request $request) + { + // Set the database + $oldDB = new OTF_DB([ 'database' => $request->input('database'), 'username' => $request->input('username'), 'password' => $request->input('password'), - 'prefix' => $request->input('prefix') + 'prefix' => $request->input('prefix'), ]); - $aircraft = $oldDB->getTable('aircraft')->get(); - $users = $oldDB->getTable('pilots')->get(); - $pireps = $oldDB->getTable('pireps')->get(); - $aircraft = $oldDB->getTable('aircraft')->get(); - $aircraft = $oldDB->getTable('aircraft')->get(); - $aircraft = $oldDB->getTable('aircraft')->get(); - $aircraft = $oldDB->getTable('aircraft')->get(); - } - public function importSystem(Request $request) { - - } - public function dbMigrate(Request $request) - { - Artisan::call('migrate'); - $request->session()->flash('success', true); - return redirect('/admin/migrations'); - } - public function viewMigrations() - { - $migrations = DB::table('migrations')->get(); - return view('admin.migrations', ['migrations' => $migrations]); - } -} \ No newline at end of file + $aircraft = $oldDB->getTable('aircraft')->get(); + $users = $oldDB->getTable('pilots')->get(); + $pireps = $oldDB->getTable('pireps')->get(); + $aircraft = $oldDB->getTable('aircraft')->get(); + $aircraft = $oldDB->getTable('aircraft')->get(); + $aircraft = $oldDB->getTable('aircraft')->get(); + $aircraft = $oldDB->getTable('aircraft')->get(); + } + + public function importSystem(Request $request) + { + } + + public function dbMigrate(Request $request) + { + Artisan::call('migrate'); + $request->session()->flash('success', true); + + return redirect('/admin/migrations'); + } + + public function viewMigrations() + { + $migrations = DB::table('migrations')->get(); + + return view('admin.migrations', ['migrations' => $migrations]); + } +} diff --git a/app/Http/Controllers/Admin/PIREPController.php b/app/Http/Controllers/Admin/PIREPController.php index c4005abf..f3385203 100644 --- a/app/Http/Controllers/Admin/PIREPController.php +++ b/app/Http/Controllers/Admin/PIREPController.php @@ -2,12 +2,10 @@ namespace App\Http\Controllers\Admin; -use App\Models\LogbookEntry as PIREP; use Illuminate\Http\Request; - -use App\Http\Requests; -use App\Http\Controllers\Controller; use App\Notifications\PirepFiled; +use App\Http\Controllers\Controller; +use App\Models\LogbookEntry as PIREP; class PIREPController extends Controller { @@ -18,9 +16,9 @@ class PIREPController extends Controller */ public function index(Request $request) { - if($request->query('view') == "pending") - { + if ($request->query('view') == 'pending') { $pireps = PIREP::where('status', 0)->with('user')->with('depapt')->with('arrapt')->with('aircraft')->get(); + return view('admin.pireps.pending', ['pireps' => $pireps]); } $pireps = PIREP::with('user')->with('depapt')->with('arrapt')->with('aircraft')->get(); @@ -42,6 +40,7 @@ public function create() * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request + * * @return \Illuminate\Http\Response */ public function store(Request $request) @@ -53,11 +52,13 @@ public function store(Request $request) * Display the specified resource. * * @param int $id + * * @return \Illuminate\Http\Response */ public function show($id) { $pirep = PIREP::where('id', $id)->with('airline')->with('depapt')->with('arrapt')->with('aircraft')->with('user')->first(); + return view('admin.pireps.detailed', ['p' => $pirep]); } @@ -65,6 +66,7 @@ public function show($id) * Show the form for editing the specified resource. * * @param int $id + * * @return \Illuminate\Http\Response */ public function edit($id) @@ -77,6 +79,7 @@ public function edit($id) * * @param \Illuminate\Http\Request $request * @param int $id + * * @return \Illuminate\Http\Response */ public function update(Request $request, $id) @@ -84,8 +87,7 @@ public function update(Request $request, $id) $pirep = PIREP::find($id); // check if we are only changing the status //dd($request); - if ($request->input('flag') == "status") - { + if ($request->input('flag') == 'status') { $pirep->status = $request->input('status'); //dd($pirep->status); $pirep->save(); @@ -99,11 +101,11 @@ public function update(Request $request, $id) * Remove the specified resource from storage. * * @param int $id + * * @return \Illuminate\Http\Response */ public function destroy($id) { // } - } diff --git a/app/Http/Controllers/Admin/ScheduleController.php b/app/Http/Controllers/Admin/ScheduleController.php index 64ba6edd..18bd9acc 100644 --- a/app/Http/Controllers/Admin/ScheduleController.php +++ b/app/Http/Controllers/Admin/ScheduleController.php @@ -2,15 +2,12 @@ namespace App\Http\Controllers\Admin; -use App\Models\AircraftGroup; use App\Models\Airline; -use App\Classes\VAOS_Schedule; use App\Models\Schedule; use Illuminate\Http\Request; - -use App\Http\Requests; +use App\Models\AircraftGroup; +use App\Classes\VAOS_Schedule; use App\Http\Controllers\Controller; -use Illuminate\Support\Facades\DB; class ScheduleController extends Controller { @@ -38,7 +35,7 @@ public function index() */ public function create() { - $airlines = Airline::all(); + $airlines = Airline::all(); $acfgroups = AircraftGroup::with('airline')->get(); //return $acfgroups; return view('admin.schedules.create', ['airlines' => $airlines, 'acfgroups' => $acfgroups]); @@ -48,6 +45,7 @@ public function create() * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request + * * @return \Illuminate\Http\Response */ public function store(Request $request) @@ -60,17 +58,17 @@ public function store(Request $request) // ok let's check and set the proper id for aircraf group VAOS_Schedule::newRoute($data); - if ($data['createReturn']) - { + if ($data['createReturn']) { // swap the departure and arrival and change the flight number - $newDep = $data['arricao']; - $newArr = $data['depicao']; - $data['depicao'] = $newDep; - $data['arricao'] = $newArr; + $newDep = $data['arricao']; + $newArr = $data['depicao']; + $data['depicao'] = $newDep; + $data['arricao'] = $newArr; $data['flightnum'] = $data['returnNumber']; VAOS_Schedule::newRoute($data); } $request->session()->flash('schedule_created', true); + return redirect('/admin/schedule'); } @@ -78,6 +76,7 @@ public function store(Request $request) * Display the specified resource. * * @param int $id + * * @return \Illuminate\Http\Response */ public function show($id) @@ -89,14 +88,16 @@ public function show($id) * Show the form for editing the specified resource. * * @param int $id + * * @return \Illuminate\Http\Response */ public function edit($id) { $schedule = Schedule::findOrFail($id); - $airlines = Airline::all(); + $airlines = Airline::all(); $acfgroups = AircraftGroup::all(); + return view('admin.schedules.edit', ['schedule' => $schedule, 'airlines' => $airlines, 'acfgroups' => $acfgroups]); } @@ -105,6 +106,7 @@ public function edit($id) * * @param \Illuminate\Http\Request $request * @param int $id + * * @return \Illuminate\Http\Response */ public function update(Request $request, $id) @@ -113,6 +115,7 @@ public function update(Request $request, $id) VAOS_Schedule::updateRoute($data, $id); $request->session()->flash('schedule_updated', true); + return redirect('/admin/schedule'); } @@ -120,12 +123,14 @@ public function update(Request $request, $id) * Remove the specified resource from storage. * * @param int $id + * * @return \Illuminate\Http\Response */ public function destroy($id) { // Delete the route from the system Schedule::destroy($id); + return redirect('/admin/schedule'); } } diff --git a/app/Http/Controllers/Admin/TypeRatingsController.php b/app/Http/Controllers/Admin/TypeRatingsController.php index cc4a8f40..7e0b861f 100644 --- a/app/Http/Controllers/Admin/TypeRatingsController.php +++ b/app/Http/Controllers/Admin/TypeRatingsController.php @@ -2,8 +2,8 @@ namespace App\Http\Controllers\Admin; -use App\Classes\VAOS_TypeRatings; use Illuminate\Http\Request; +use App\Classes\VAOS_TypeRatings; use App\Http\Controllers\Controller; class TypeRatingsController extends Controller @@ -32,16 +32,18 @@ public function create() * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request + * * @return \Illuminate\Http\Response */ public function store(Request $request) { VAOS_TypeRatings::AddTypeRating([ 'airline' => $request->input('airline'), - 'code' => $request->input('code'), - 'name' => $request->input('name') + 'code' => $request->input('code'), + 'name' => $request->input('name'), ]); + return route('admin.typeratings.index'); } @@ -49,6 +51,7 @@ public function store(Request $request) * Display the specified resource. * * @param int $id + * * @return \Illuminate\Http\Response */ public function show($id) @@ -60,6 +63,7 @@ public function show($id) * Show the form for editing the specified resource. * * @param int $id + * * @return \Illuminate\Http\Response */ public function edit($id) @@ -72,6 +76,7 @@ public function edit($id) * * @param \Illuminate\Http\Request $request * @param int $id + * * @return \Illuminate\Http\Response */ public function update(Request $request, $id) @@ -83,6 +88,7 @@ public function update(Request $request, $id) * Remove the specified resource from storage. * * @param int $id + * * @return \Illuminate\Http\Response */ public function destroy($id) diff --git a/app/Http/Controllers/Admin/UsersController.php b/app/Http/Controllers/Admin/UsersController.php index a4ea1f85..e76894c6 100644 --- a/app/Http/Controllers/Admin/UsersController.php +++ b/app/Http/Controllers/Admin/UsersController.php @@ -2,14 +2,12 @@ namespace App\Http\Controllers\Admin; -use App\Models\Airline; +use App\User; use App\Models\Hub; +use App\Models\Airline; use Illuminate\Http\Request; - -use App\Http\Requests; -use App\User; -use App\Http\Controllers\Controller; use Illuminate\Validation\Rule; +use App\Http\Controllers\Controller; class UsersController extends Controller { @@ -21,6 +19,7 @@ class UsersController extends Controller public function index() { $users = User::all(); + return view('admin.users.view', ['users' => $users]); } @@ -38,6 +37,7 @@ public function create() * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request + * * @return \Illuminate\Http\Response */ public function store(Request $request) @@ -49,13 +49,15 @@ public function store(Request $request) * Display the specified resource. * * @param int $id + * * @return \Illuminate\Http\Response */ public function show($id) { - $user = User::findOrFail($id); + $user = User::findOrFail($id); $airlines = Airline::all(); - $hubs = Hub::all(); + $hubs = Hub::all(); + return view('admin.users.show', ['user' => $user, 'airlines' => $airlines, 'hubs' => $hubs]); } @@ -63,6 +65,7 @@ public function show($id) * Show the form for editing the specified resource. * * @param int $id + * * @return \Illuminate\Http\Response */ public function edit($id) @@ -75,58 +78,59 @@ public function edit($id) * * @param \Illuminate\Http\Request $request * @param int $id + * * @return \Illuminate\Http\Response */ public function update(Request $request, $id) { $this->validate($request, [ 'first_name' => 'required|string', - 'last_name' => 'required|string', - 'email' => [ + 'last_name' => 'required|string', + 'email' => [ 'required', 'email', Rule::unique('users')->ignore($id), ], 'vatsim' => 'integer', - 'ivao' => 'integer', + 'ivao' => 'integer', ]); $user = User::find($id); $user->first_name = $request->first_name; - $user->last_name = $request->last_name; - $user->email = $request->email; + $user->last_name = $request->last_name; + $user->email = $request->email; - - if(strlen($request->cover_url) > 0) { + if (strlen($request->cover_url) > 0) { $user->cover_url = $request->cover_url; } else { $user->cover_url = null; } - if(strlen($request->avatar_url) > 0) { + if (strlen($request->avatar_url) > 0) { $user->avatar_url = $request->avatar_url; } else { $user->avatar_url = null; } - if(strlen($request->vatsim) > 0) { + if (strlen($request->vatsim) > 0) { $user->vatsim = $request->vatsim; } else { $user->vatsim = null; } - if(strlen($request->ivao) > 0) { + if (strlen($request->ivao) > 0) { $user->ivao = $request->ivao; } else { $user->ivao = null; } - if($request->admin == 1) + if ($request->admin == 1) { $user->admin = $request->admin; - else + } else { $user->admin = 0; - + } + $user->status = $request->status; $user->save(); @@ -134,11 +138,11 @@ public function update(Request $request, $id) return redirect('admin/users/'.$id); } + public function airlineMod(Request $request, $id) { // first let's check to see what the action is. - if ($request->input('action') === "add") - { + if ($request->input('action') === 'add') { // Ok, now let's get started. Add the user to the foreign key with the supplied info $user = User::find($id); @@ -146,17 +150,19 @@ public function airlineMod(Request $request, $id) $user->airlines()->attach($airline, [ 'pilot_id' => $request->input('pilotid'), - 'hub_id' => Hub::find($id), - 'status' => 1, - 'primary' => false, - 'admin' => false + 'hub_id' => Hub::find($id), + 'status' => 1, + 'primary' => false, + 'admin' => false, ]); } } + /** * Remove the specified resource from storage. * * @param int $id + * * @return \Illuminate\Http\Response */ public function destroy($id) diff --git a/app/Http/Controllers/AirlineStaff/AdminController.php b/app/Http/Controllers/AirlineStaff/AdminController.php index 46189626..18dbcd32 100644 --- a/app/Http/Controllers/AirlineStaff/AdminController.php +++ b/app/Http/Controllers/AirlineStaff/AdminController.php @@ -2,10 +2,6 @@ namespace App\Http\Controllers\AirlineStaff; -use App\ScheduleTemplate; -use Illuminate\Http\Request; - -use App\Http\Requests; use App\Http\Controllers\Controller; class AdminController extends Controller diff --git a/app/Http/Controllers/AirlineStaff/BidsController.php b/app/Http/Controllers/AirlineStaff/BidsController.php index 7b24e816..1b57c0fb 100644 --- a/app/Http/Controllers/AirlineStaff/BidsController.php +++ b/app/Http/Controllers/AirlineStaff/BidsController.php @@ -31,6 +31,7 @@ public function create($airline) * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request + * * @return \Illuminate\Http\Response */ public function store($airline, Request $request) @@ -42,6 +43,7 @@ public function store($airline, Request $request) * Display the specified resource. * * @param int $id + * * @return \Illuminate\Http\Response */ public function show($airline, $id) @@ -53,6 +55,7 @@ public function show($airline, $id) * Show the form for editing the specified resource. * * @param int $id + * * @return \Illuminate\Http\Response */ public function edit($airline, $id) @@ -65,6 +68,7 @@ public function edit($airline, $id) * * @param \Illuminate\Http\Request $request * @param int $id + * * @return \Illuminate\Http\Response */ public function update($airline, Request $request, $id) @@ -76,6 +80,7 @@ public function update($airline, Request $request, $id) * Remove the specified resource from storage. * * @param int $id + * * @return \Illuminate\Http\Response */ public function destroy($airline, $id) diff --git a/app/Http/Controllers/AirlineStaff/FleetController.php b/app/Http/Controllers/AirlineStaff/FleetController.php index da1131a6..058f6719 100644 --- a/app/Http/Controllers/AirlineStaff/FleetController.php +++ b/app/Http/Controllers/AirlineStaff/FleetController.php @@ -2,12 +2,11 @@ namespace App\Http\Controllers\AirlineStaff; -use App\Classes\VAOS_Aircraft; -use App\Models\Aircraft; -use Illuminate\Http\Request; use App\Airline; use App\AircraftGroup; -use App\Http\Requests; +use App\Models\Aircraft; +use Illuminate\Http\Request; +use App\Classes\VAOS_Aircraft; use App\Http\Controllers\Controller; class FleetController extends Controller @@ -31,8 +30,9 @@ public function index() */ public function create() { - $airlines = Airline::all(); + $airlines = Airline::all(); $acfgroups = AircraftGroup::where('userdefined', true)->get(); + return view('admin.fleet.create', ['airlines' => $airlines, 'acfgroups' => $acfgroups]); } @@ -40,29 +40,32 @@ public function create() * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request + * * @return \Illuminate\Http\Response */ public function store(Request $request) { - $data = array(); - $data['icao'] = $request->input('icao'); - $data['name'] = $request->input('name'); + $data = []; + $data['icao'] = $request->input('icao'); + $data['name'] = $request->input('name'); $data['manufacturer'] = $request->input('manufacturer'); $data['registration'] = $request->input('registration'); - $data['range'] = $request->input('range'); - $data['maxpax'] = $request->input('maxpax'); - $data['maxgw'] = $request->input('maxgw'); - if ($request->input('status') == 1) + $data['range'] = $request->input('range'); + $data['maxpax'] = $request->input('maxpax'); + $data['maxgw'] = $request->input('maxgw'); + if ($request->input('status') == 1) { $data['status'] = $request->input('status'); - else + } else { $data['status'] = 0; + } $data['airline'] = $request->input('airline'); - $data['hub'] = null; - $data['group'] = null; + $data['hub'] = null; + $data['group'] = null; //dd($data); if (VAOS_Aircraft::createAircraft($data)) { $request->session()->flash('aircraft_created', true); + return redirect('admin/fleet'); } else { dd($data); @@ -73,6 +76,7 @@ public function store(Request $request) * Display the specified resource. * * @param int $id + * * @return \Illuminate\Http\Response */ public function show($id) @@ -84,14 +88,16 @@ public function show($id) * Show the form for editing the specified resource. * * @param int $id + * * @return \Illuminate\Http\Response */ public function edit($id) { $aircraft = Aircraft::findOrFail($id); - $airlines = Airline::all(); + $airlines = Airline::all(); $acfgroups = AircraftGroup::where('userdefined', true)->get(); + return view('admin.fleet.edit', ['aircraft' => $aircraft, 'airlines' => $airlines, 'acfgroups' => $acfgroups]); } @@ -100,30 +106,33 @@ public function edit($id) * * @param \Illuminate\Http\Request $request * @param int $id + * * @return \Illuminate\Http\Response */ public function update(Request $request, $id) { - $data = array(); - $data['icao'] = $request->input('icao'); - $data['name'] = $request->input('name'); + $data = []; + $data['icao'] = $request->input('icao'); + $data['name'] = $request->input('name'); $data['manufacturer'] = $request->input('manufacturer'); $data['registration'] = $request->input('registration'); - $data['range'] = $request->input('range'); - $data['maxpax'] = $request->input('maxpax'); - $data['maxgw'] = $request->input('maxgw'); + $data['range'] = $request->input('range'); + $data['maxpax'] = $request->input('maxpax'); + $data['maxgw'] = $request->input('maxgw'); - if ($request->input('status') == 1) + if ($request->input('status') == 1) { $data['status'] = $request->input('status'); - else + } else { $data['status'] = 0; + } $data['airline'] = $request->input('airline'); - $data['hub'] = null; - $data['group'] = null; + $data['hub'] = null; + $data['group'] = null; //dd($data); if (VAOS_Aircraft::updateAircraft($data, $id)) { $request->session()->flash('aircraft_updated', true); + return redirect('admin/fleet'); } else { dd($data); @@ -134,6 +143,7 @@ public function update(Request $request, $id) * Remove the specified resource from storage. * * @param int $id + * * @return \Illuminate\Http\Response */ public function destroy($id) diff --git a/app/Http/Controllers/AirlineStaff/ImportExportController.php b/app/Http/Controllers/AirlineStaff/ImportExportController.php index 86f4e055..e48890ec 100644 --- a/app/Http/Controllers/AirlineStaff/ImportExportController.php +++ b/app/Http/Controllers/AirlineStaff/ImportExportController.php @@ -2,32 +2,30 @@ namespace App\Http\Controllers\AirlineStaff; -use App\AircraftGroup; use App\Airline; -use App\Classes\AircraftData; -use App\Classes\VAOS_Schedule; use App\Models\JobProgress; use Illuminate\Http\Request; -use Illuminate\Support\Facades\Storage; +use App\Classes\AircraftData; +use App\Classes\VAOS_Schedule; use App\Http\Controllers\Controller; use Maatwebsite\Excel\Facades\Excel; +use Illuminate\Support\Facades\Storage; class ImportExportController extends Controller { public function getSystem(Request $request) { - } + public function postSystem(Request $request) { - if ($request->query('task') == 'import') - { + if ($request->query('task') == 'import') { $progress = new JobProgress([ - 'task' => 'import', - 'slug' => 'Import VAOS System', - 'description' => 'Uploading Workbook', - 'totalitems' => 1, - 'itemscompleted' => 0 + 'task' => 'import', + 'slug' => 'Import VAOS System', + 'description' => 'Uploading Workbook', + 'totalitems' => 1, + 'itemscompleted' => 0, ]); // Import the File to the file system @@ -35,27 +33,28 @@ public function postSystem(Request $request) // Load the Excel Import Object Excel::load($path, function ($reader) { - }); - } } + public function getAirlines(Request $request) { $path = $request->file('file')->store('data'); } + public function PostAirlines(Request $request) { $path = $request->file('file')->store('data'); } + public function getFleet(Request $request) { - return view('admin.data.import',['route' => 'fleet']); + return view('admin.data.import', ['route' => 'fleet']); } + public function postFleet(Request $request) { - if ($request->query('action') == 'import') - { + if ($request->query('action') == 'import') { /* $progress = new JobProgress([ 'task' => 'import', @@ -73,20 +72,19 @@ public function postFleet(Request $request) $data = json_decode(Storage::get($path), true); - foreach ($data as $row) - { + foreach ($data as $row) { //$airline_id = Airline::where('icao', $row['airline'])->first(); //$row['airline'] = $airline_id->id; $data = [ - 'airline' => Airline::where('icao', $row['airline'])->first(), - 'icao' => $row['icao'], - 'name' => $row['name'], + 'airline' => Airline::where('icao', $row['airline'])->first(), + 'icao' => $row['icao'], + 'name' => $row['name'], 'manufacturer' => $row['manufacturer'], 'registration' => $row['registration'], - 'range' => $row['range'], - 'maxgw' => $row['maxgw'], - 'maxpax' => $row['maxpax'], - 'status' => $row['status'] + 'range' => $row['range'], + 'maxgw' => $row['maxgw'], + 'maxpax' => $row['maxpax'], + 'status' => $row['status'], ]; AircraftData::createAircraft($data); } @@ -96,35 +94,34 @@ public function postFleet(Request $request) return redirect('/admin/fleet'); } } + public function getSchedule(Request $request) { - return view('admin.data.import',['route' => 'schedule']); + return view('admin.data.import', ['route' => 'schedule']); } + public function postSchedule(Request $request) { - if ($request->query('action') == 'import') - { - + if ($request->query('action') == 'import') { $path = $request->file('file')->storeAS('imports', 'schedule.json'); //dd($path); // Load the Excel Import Object $data = json_decode(Storage::get($path), true); - foreach ($data as $d) - { + foreach ($data as $d) { $route = [ - 'depicao' => $d['depicao'], - 'arricao' => $d['arricao'], - 'airline' => $d['airline'], - 'flightnum' => $d['flightnum'], + 'depicao' => $d['depicao'], + 'arricao' => $d['arricao'], + 'airline' => $d['airline'], + 'flightnum' => $d['flightnum'], 'aircraft_group' => $d['aircraft_group'], - 'type' => $d['type'], - 'enabled' => $d['enabled'] + 'type' => $d['type'], + 'enabled' => $d['enabled'], ]; VAOS_Schedule::newRoute($route); } $request->session()->flash('success', 'Routes imported successfully.'); - + return redirect('/admin/schedule'); } } diff --git a/app/Http/Controllers/AirlineStaff/PIREPController.php b/app/Http/Controllers/AirlineStaff/PIREPController.php index 8a8b2495..090932bf 100644 --- a/app/Http/Controllers/AirlineStaff/PIREPController.php +++ b/app/Http/Controllers/AirlineStaff/PIREPController.php @@ -4,10 +4,8 @@ use App\PIREP; use Illuminate\Http\Request; - -use App\Http\Requests; -use App\Http\Controllers\Controller; use App\Notifications\PirepFiled; +use App\Http\Controllers\Controller; class PIREPController extends Controller { @@ -18,9 +16,9 @@ class PIREPController extends Controller */ public function index(Request $request) { - if($request->query('view') == "pending") - { + if ($request->query('view') == 'pending') { $pireps = PIREP::where('status', 0)->with('user')->with('depapt')->with('arrapt')->with('aircraft')->get(); + return view('admin.pireps.pending', ['pireps' => $pireps]); } $pireps = PIREP::with('user')->with('depapt')->with('arrapt')->with('aircraft')->get(); @@ -42,6 +40,7 @@ public function create() * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request + * * @return \Illuminate\Http\Response */ public function store(Request $request) @@ -53,11 +52,13 @@ public function store(Request $request) * Display the specified resource. * * @param int $id + * * @return \Illuminate\Http\Response */ public function show($id) { $pirep = PIREP::where('id', $id)->with('airline')->with('depapt')->with('arrapt')->with('aircraft')->with('user')->first(); + return view('admin.pireps.detailed', ['p' => $pirep]); } @@ -65,6 +66,7 @@ public function show($id) * Show the form for editing the specified resource. * * @param int $id + * * @return \Illuminate\Http\Response */ public function edit($id) @@ -77,6 +79,7 @@ public function edit($id) * * @param \Illuminate\Http\Request $request * @param int $id + * * @return \Illuminate\Http\Response */ public function update(Request $request, $id) @@ -84,8 +87,7 @@ public function update(Request $request, $id) $pirep = PIREP::find($id); // check if we are only changing the status //dd($request); - if ($request->input('flag') == "status") - { + if ($request->input('flag') == 'status') { $pirep->status = $request->input('status'); //dd($pirep->status); $pirep->save(); @@ -99,11 +101,11 @@ public function update(Request $request, $id) * Remove the specified resource from storage. * * @param int $id + * * @return \Illuminate\Http\Response */ public function destroy($id) { // } - } diff --git a/app/Http/Controllers/AirlineStaff/ScheduleController.php b/app/Http/Controllers/AirlineStaff/ScheduleController.php index 60a0d9d2..948e8bc9 100644 --- a/app/Http/Controllers/AirlineStaff/ScheduleController.php +++ b/app/Http/Controllers/AirlineStaff/ScheduleController.php @@ -2,15 +2,12 @@ namespace App\Http\Controllers\AirlineStaff; -use App\Models\AircraftGroup; use App\Models\Airline; -use App\Classes\VAOS_Schedule; use App\Models\Schedule; use Illuminate\Http\Request; - -use App\Http\Requests; +use App\Models\AircraftGroup; +use App\Classes\VAOS_Schedule; use App\Http\Controllers\Controller; -use Illuminate\Support\Facades\DB; class ScheduleController extends Controller { @@ -35,8 +32,9 @@ public function index($airline) */ public function create() { - $airlines = Airline::all(); + $airlines = Airline::all(); $acfgroups = AircraftGroup::all(); + return view('admin.schedules.create', ['airlines' => $airlines, 'acfgroups' => $acfgroups]); } @@ -44,6 +42,7 @@ public function create() * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request + * * @return \Illuminate\Http\Response */ public function store(Request $request) @@ -55,6 +54,7 @@ public function store(Request $request) VAOS_Schedule::newRoute($data); $request->session()->flash('schedule_created', true); + return redirect('/admin/schedule'); } @@ -62,6 +62,7 @@ public function store(Request $request) * Display the specified resource. * * @param int $id + * * @return \Illuminate\Http\Response */ public function show($id) @@ -73,14 +74,16 @@ public function show($id) * Show the form for editing the specified resource. * * @param int $id + * * @return \Illuminate\Http\Response */ public function edit($id) { $schedule = Schedule::findOrFail($id); - $airlines = Airline::all(); + $airlines = Airline::all(); $acfgroups = AircraftGroup::all(); + return view('admin.schedules.edit', ['schedule' => $schedule, 'airlines' => $airlines, 'acfgroups' => $acfgroups]); } @@ -89,6 +92,7 @@ public function edit($id) * * @param \Illuminate\Http\Request $request * @param int $id + * * @return \Illuminate\Http\Response */ public function update(Request $request, $id) @@ -97,6 +101,7 @@ public function update(Request $request, $id) VAOS_Schedule::updateRoute($data, $id); $request->session()->flash('schedule_updated', true); + return redirect('/admin/schedule'); } @@ -104,12 +109,14 @@ public function update(Request $request, $id) * Remove the specified resource from storage. * * @param int $id + * * @return \Illuminate\Http\Response */ public function destroy($id) { // Delete the route from the system Schedule::destroy($id); + return redirect('/admin/schedule'); } } diff --git a/app/Http/Controllers/AirlineStaff/TypeRatingsController.php b/app/Http/Controllers/AirlineStaff/TypeRatingsController.php index 4db729f5..ac52b43f 100644 --- a/app/Http/Controllers/AirlineStaff/TypeRatingsController.php +++ b/app/Http/Controllers/AirlineStaff/TypeRatingsController.php @@ -2,7 +2,6 @@ namespace App\Http\Controllers\AirlineStaff; -use Illuminate\Http\Request; use App\Http\Controllers\Controller; class TypeRatingsController extends Controller diff --git a/app/Http/Controllers/AirlineStaff/UsersController.php b/app/Http/Controllers/AirlineStaff/UsersController.php index cfce51da..0d4c01ea 100644 --- a/app/Http/Controllers/AirlineStaff/UsersController.php +++ b/app/Http/Controllers/AirlineStaff/UsersController.php @@ -2,12 +2,10 @@ namespace App\Http\Controllers\AirlineStaff; -use Illuminate\Http\Request; - -use App\Http\Requests; use App\User; -use App\Http\Controllers\Controller; +use Illuminate\Http\Request; use Illuminate\Validation\Rule; +use App\Http\Controllers\Controller; class UsersController extends Controller { @@ -19,6 +17,7 @@ class UsersController extends Controller public function index() { $users = User::all(); + return view('admin.users.view', ['users' => $users]); } @@ -36,6 +35,7 @@ public function create() * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request + * * @return \Illuminate\Http\Response */ public function store(Request $request) @@ -47,6 +47,7 @@ public function store(Request $request) * Display the specified resource. * * @param int $id + * * @return \Illuminate\Http\Response */ public function show($id) @@ -60,6 +61,7 @@ public function show($id) * Show the form for editing the specified resource. * * @param int $id + * * @return \Illuminate\Http\Response */ public function edit($id) @@ -72,59 +74,61 @@ public function edit($id) * * @param \Illuminate\Http\Request $request * @param int $id + * * @return \Illuminate\Http\Response */ public function update(Request $request, $id) { $this->validate($request, [ 'first_name' => 'required|string', - 'last_name' => 'required|string', - 'email' => [ + 'last_name' => 'required|string', + 'email' => [ 'required', 'email', Rule::unique('users')->ignore($id), ], 'vatsim' => 'integer', - 'ivao' => 'integer', + 'ivao' => 'integer', ]); $user = User::find($id); $user->first_name = $request->first_name; - $user->last_name = $request->last_name; - $user->email = $request->email; + $user->last_name = $request->last_name; + $user->email = $request->email; $user->pilotid = $request->pilotid; - if(strlen($request->cover_url) > 0) { + if (strlen($request->cover_url) > 0) { $user->cover_url = $request->cover_url; } else { $user->cover_url = null; } - if(strlen($request->avatar_url) > 0) { + if (strlen($request->avatar_url) > 0) { $user->avatar_url = $request->avatar_url; } else { $user->avatar_url = null; } - if(strlen($request->vatsim) > 0) { + if (strlen($request->vatsim) > 0) { $user->vatsim = $request->vatsim; } else { $user->vatsim = null; } - if(strlen($request->ivao) > 0) { + if (strlen($request->ivao) > 0) { $user->ivao = $request->ivao; } else { $user->ivao = null; } - if($request->admin == 1) + if ($request->admin == 1) { $user->admin = $request->admin; - else + } else { $user->admin = 0; - + } + $user->status = $request->status; $user->save(); @@ -137,6 +141,7 @@ public function update(Request $request, $id) * Remove the specified resource from storage. * * @param int $id + * * @return \Illuminate\Http\Response */ public function destroy($id) diff --git a/app/Http/Controllers/Auth/LoginController.php b/app/Http/Controllers/Auth/LoginController.php index 6fb359b9..e61318a5 100644 --- a/app/Http/Controllers/Auth/LoginController.php +++ b/app/Http/Controllers/Auth/LoginController.php @@ -2,9 +2,9 @@ namespace App\Http\Controllers\Auth; +use Illuminate\Http\Request; use App\Http\Controllers\Controller; use Illuminate\Foundation\Auth\AuthenticatesUsers; -use Illuminate\Http\Request; class LoginController extends Controller { @@ -35,13 +35,15 @@ class LoginController extends Controller */ /** - * Override the trait method to allow login using either email or username + * Override the trait method to allow login using either email or username. + * * @param Request $request + * * @return array */ protected function credentials(Request $request) { - $usernameInput = trim($request->{$this->username()}); + $usernameInput = trim($request->{$this->username()}); $usernameColumn = filter_var($usernameInput, FILTER_VALIDATE_EMAIL) ? 'email' : $this->username(); return [$usernameColumn => $usernameInput, 'password' => $request->password]; diff --git a/app/Http/Controllers/Auth/RegisterController.php b/app/Http/Controllers/Auth/RegisterController.php index 8becc6b2..1399e311 100644 --- a/app/Http/Controllers/Auth/RegisterController.php +++ b/app/Http/Controllers/Auth/RegisterController.php @@ -43,36 +43,34 @@ public function __construct() * Get a validator for an incoming registration request. * * @param array $data + * * @return \Illuminate\Contracts\Validation\Validator */ protected function validator(array $data) { // Check if reCAPTCHA credentials set - if(!empty(config('recaptcha.public_key') && config('recaptcha.private_key'))) { - + if (! empty(config('recaptcha.public_key') && config('recaptcha.private_key'))) { + // Return with reCAPTCHA validator return Validator::make($data, [ - 'first_name' => 'required|max:255', - 'last_name' => 'required|max:255', - 'username' => 'required|max:255', - 'email' => 'required|email|max:255|unique:users', - 'password' => 'required|min:6|confirmed', + 'first_name' => 'required|max:255', + 'last_name' => 'required|max:255', + 'username' => 'required|max:255', + 'email' => 'required|email|max:255|unique:users', + 'password' => 'required|min:6|confirmed', 'g-recaptcha-response' => 'recaptcha', ]); - } else { // reCAPTCHA credentials not set return Validator::make($data, [ 'first_name' => 'required|max:255', - 'last_name' => 'required|max:255', - 'username' => 'required|max:255', - 'email' => 'required|email|max:255|unique:users', - 'password' => 'required|min:6|confirmed', + 'last_name' => 'required|max:255', + 'username' => 'required|max:255', + 'email' => 'required|email|max:255|unique:users', + 'password' => 'required|min:6|confirmed', ]); - } - } /** @@ -80,20 +78,19 @@ protected function validator(array $data) * * @param array $data * @param array $data + * * @return User */ protected function create(array $data) { - return User::create([ 'first_name' => $data['first_name'], - 'last_name' => $data['last_name'], - 'email' => $data['email'], - 'password' => bcrypt($data['password']), - 'username' => $data['username'], - 'status' => 0, - 'admin' => false + 'last_name' => $data['last_name'], + 'email' => $data['email'], + 'password' => bcrypt($data['password']), + 'username' => $data['username'], + 'status' => 0, + 'admin' => false, ]); - } } diff --git a/app/Http/Controllers/Auth/phpVMSMigrationController.php b/app/Http/Controllers/Auth/phpVMSMigrationController.php index 8ed7c9dc..accdec47 100644 --- a/app/Http/Controllers/Auth/phpVMSMigrationController.php +++ b/app/Http/Controllers/Auth/phpVMSMigrationController.php @@ -4,8 +4,8 @@ use App\User; use Illuminate\Http\Request; -use App\Http\Controllers\Controller; use Illuminate\Support\Facades\DB; +use App\Http\Controllers\Controller; class phpVMSMigrationController extends Controller { @@ -13,41 +13,40 @@ public function index() { return view('auth.migrateLogin'); } + public function doMigration(Request $request) { // Ok now, let's authenticate him. $user = DB::table('legacy_pilots')->where('email', $request->input('email'))->first(); - if (!$user) { + if (! $user) { $request->session()->flash('user_not_found', true); + return back(); } $hashed = md5($request->input('password').$user['salt']); // Ok now check if it matches - if ($user->password = $hashed) - { + if ($user->password = $hashed) { // It matches, so create a new user now in the database and store his current password in the new format. return User::create([ 'first_name' => $user['firstname'], - 'last_name' => $user['lastname'], - 'email' => $user['email'], - 'password' => bcrypt($request->input('password')), - 'username' => strtolower($user['firstname'].$user['lastname']), - 'status' => 1, - 'admin' => false + 'last_name' => $user['lastname'], + 'email' => $user['email'], + 'password' => bcrypt($request->input('password')), + 'username' => strtolower($user['firstname'].$user['lastname']), + 'status' => 1, + 'admin' => false, ]); - } - else - { + } else { // It's incorrect, so lets let them know the password didn't match. $request->session()->flash('password_mismatch', true); + return back(); } - } + public function applyNewSettings(Request $request) { - } } diff --git a/app/Http/Controllers/CrewOps/AirlineController.php b/app/Http/Controllers/CrewOps/AirlineController.php index 7387c3de..f2818dc0 100644 --- a/app/Http/Controllers/CrewOps/AirlineController.php +++ b/app/Http/Controllers/CrewOps/AirlineController.php @@ -3,7 +3,6 @@ namespace App\Http\Controllers\CrewOps; use App\Models\Airline; -use Illuminate\Http\Request; use App\Http\Controllers\Controller; use Illuminate\Support\Facades\Auth; @@ -17,19 +16,14 @@ public function index() // Ok now figure out if the user logged in is in the airline. If so, throw his info up and center. - foreach ($airlines as $airline) - { + foreach ($airlines as $airline) { // Check the relationship to see if the user has the above airline. - if ($user->hasAirline($airline)) - { + if ($user->hasAirline($airline)) { $airline->inAirline = true; - } - else - { + } else { $airline->inAirline = false; } - } //return $airlines; diff --git a/app/Http/Controllers/CrewOps/BiddingController.php b/app/Http/Controllers/CrewOps/BiddingController.php index a8703b32..17610af4 100644 --- a/app/Http/Controllers/CrewOps/BiddingController.php +++ b/app/Http/Controllers/CrewOps/BiddingController.php @@ -3,8 +3,8 @@ namespace App\Http\Controllers\CrewOps; use App\Models\Flight; -use App\Classes\VAOS_Schedule; use Illuminate\Http\Request; +use App\Classes\VAOS_Schedule; use App\Http\Controllers\Controller; use Illuminate\Support\Facades\Auth; @@ -18,6 +18,7 @@ class BiddingController extends Controller public function index() { $flights = Flight::where('user_id', Auth::user()->id)->with('user')->with('airline')->with('depapt')->with('arrapt')->with('aircraft')->get(); + return view('crewops.flights.view', ['flights' => $flights]); } @@ -28,27 +29,27 @@ public function index() */ public function create() { - } /** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request + * * @return \Illuminate\Http\Response */ public function store(Request $request) { // file the bid within the system. - if ($request->input('aircraft_id') === null) + if ($request->input('aircraft_id') === null) { // The schedule filed has a aircraft group assigned. Let the system handle it. $flight = VAOS_Schedule::fileBid(Auth::user()->id, $request->input('schedule_id')); - else + } else { // No group assignment. This means an aircraft nees to be provided. Otherwise it will fail. $flight = VAOS_Schedule::fileBid(Auth::user()->id, $request->input('schedule_id'), $request->input('aircraft_id')); + } - if ($flight) - { + if ($flight) { return redirect('/flightops'); } } @@ -57,11 +58,13 @@ public function store(Request $request) * Display the specified resource. * * @param int $id + * * @return \Illuminate\Http\Response */ public function show($id) { $flight = Flight::with('user')->with('airline')->with('depapt')->with('arrapt')->with('aircraft')->find($id); + return view('crewops.flights.planning', ['flight' => $flight]); } @@ -69,6 +72,7 @@ public function show($id) * Show the form for editing the specified resource. * * @param int $id + * * @return \Illuminate\Http\Response */ public function edit($id) @@ -81,6 +85,7 @@ public function edit($id) * * @param \Illuminate\Http\Request $request * @param int $id + * * @return \Illuminate\Http\Response */ public function update(Request $request, $id) @@ -92,11 +97,13 @@ public function update(Request $request, $id) * Remove the specified resource from storage. * * @param int $id + * * @return \Illuminate\Http\Response */ public function destroy($id) { VAOS_Schedule::deleteBid($id, Auth::user()->id); + return redirect('/flightops/flights'); } } diff --git a/app/Http/Controllers/CrewOps/CrewOpsController.php b/app/Http/Controllers/CrewOps/CrewOpsController.php index 9b27056e..7b696c9c 100644 --- a/app/Http/Controllers/CrewOps/CrewOpsController.php +++ b/app/Http/Controllers/CrewOps/CrewOpsController.php @@ -2,18 +2,18 @@ namespace App\Http\Controllers\CrewOps; -use App\Models\AircraftGroup; -use App\Models\Airline; +use App\User; use App\Models\Flight; -use App\Models\Aircraft; +use App\Models\Airline; use App\Models\Airport; -use App\Models\LogbookEntry as PIREP; +use App\Models\Aircraft; use App\Models\Schedule; -use App\User; -use Illuminate\Support\Facades\Auth; use Illuminate\Http\Request; -use App\Http\Controllers\Controller; +use App\Models\AircraftGroup; use Illuminate\Validation\Rule; +use App\Http\Controllers\Controller; +use Illuminate\Support\Facades\Auth; +use App\Models\LogbookEntry as PIREP; class CrewOpsController extends Controller { @@ -22,8 +22,10 @@ public function index() // Get the total number of flights for the user $totalbids = Flight::where('user_id', Auth::user()->id)->get(); $totalLogs = Flight::where(['user_id' => Auth::user()->id, 'status' => 10])->get(); + return view('crewops.dashboard', ['flights' => $totalbids, 'logs' => $totalLogs]); } + public function profileUpdate(Request $request) { $this->validate($request, [ @@ -32,26 +34,27 @@ public function profileUpdate(Request $request) 'email', Rule::unique('users')->ignore(Auth::id()), ], - 'vatsim' => 'integer', - 'ivao' => 'integer', - 'password' => 'same:password2', + 'vatsim' => 'integer', + 'ivao' => 'integer', + 'password' => 'same:password2', 'password2' => 'same:password', ]); $user = User::find(Auth::id()); - $user->email = $request->email; + $user->email = $request->email; $user->vatsim = $request->vatsim; - $user->ivao = $request->ivao; + $user->ivao = $request->ivao; - if(!empty($request->password)) { + if (! empty($request->password)) { $user->password = bcrypt($request->password); } $user->save(); - return redirect('flightops/profile/' . Auth::id()); + return redirect('flightops/profile/'.Auth::id()); } + public function profileShow($id) { $user = User::findOrFail($id); @@ -63,57 +66,60 @@ public function profileShow($id) return view('crewops.profile.view', ['user' => $user, 'pireps' => $pireps]); } + public function profileEdit() { // Check if the user is the right user. We don't want someone modifying other people's profile. $user = User::find(Auth::user()->id); + return view('crewops.profile.edit', ['user' => $user]); } + public function getSchedule(Request $request) { - if ($request->query('individual') == 'true') - { + if ($request->query('individual') == 'true') { dd($request); - } - else { - $query = array(); + } else { + $query = []; // Check the request for specific info?? - if ($request->has('airline')) + if ($request->has('airline')) { $query['airline_id'] = Airline::where('icao', $request->query('airline'))->first()->id; + } - if ($request->has('depapt')) + if ($request->has('depapt')) { $query['depapt_id'] = Airport::where('icao', $request->query('depapt'))->first()->id; + } - if ($request->has('arrapt')) + if ($request->has('arrapt')) { $query['arrapt_id'] = Airport::where('icao', $request->query('arrapt'))->first()->id; + } - if ($request->has('aircraft')) + if ($request->has('aircraft')) { $query['aircraft_group_id'] = AircraftGroup::where('icao', $request->query('aircraft'))->first()->id; + } //dd($query); // Load all the schedules within the database if (empty($query)) { $schedules = Schedule::with('depapt')->with('arrapt')->with('airline')->with('aircraft_group')->orderBy('airline_id', 'desc')->paginate(8); - //dd($schedules); - } else + //dd($schedules); + } else { $schedules = Schedule::where($query)->with('depapt')->with('arrapt')->with('airline')->with('aircraft_group')->orderBy('arrapt_id', 'desc')->paginate(8); + } $aircraft = Aircraft::all(); //$schedules = Schedule::all(); //dd($schedules); // Return the view - foreach ($schedules as $s) - { + foreach ($schedules as $s) { $s->primary_aircraft = null; if (is_null($s->deptime)) { - $s->deptime = "N/A"; + $s->deptime = 'N/A'; } if (is_null($s->arrtime)) { - $s->arrtime = "N/A"; + $s->arrtime = 'N/A'; } - foreach($s->aircraft_group as $a) - { - if ($a['pivot']['primary']) - { + foreach ($s->aircraft_group as $a) { + if ($a['pivot']['primary']) { $s->primary_aircraft = $a->icao; } } @@ -122,60 +128,69 @@ public function getSchedule(Request $request) return view('crewops.schedule.view', ['schedules' => $schedules, 'aircraft' => $aircraft]); } } + public function getScheduleAJAX(Request $request) { // Find out what we are searching for. $schedules = new Schedule; } + public function getLogbook() { $pireps = PIREP::where('user_id', Auth::user()->id)->with('airline')->with('depapt')->with('arrapt')->with('aircraft')->get(); + return view('crewops.logbook.view', ['pireps' => $pireps]); } + public function getScheduleSearch() { $airports = Airport::all(); $airlines = Airline::all(); $aircraft = AircraftGroup::all(); + return view('crewops.schedule.search', ['airports' => $airports, 'airlines' => $airlines, 'aircraft' => $aircraft]); } + public function getRoster() { $users = User::all(); return view('crewops.roster.view', ['users' => $users]); } + public function postManualPirep(Request $request) { - $flightinfo = Flight::find($request->bid); - $pirep = new PIREP(); + $pirep = new PIREP(); $pirep->user()->associate(Auth::user()->id); $pirep->airline()->associate($flightinfo->airline_id); $pirep->aircraft()->associate($flightinfo->aircraft_id); $pirep->depapt()->associate($flightinfo->depapt_id); $pirep->arrapt()->associate($flightinfo->arrapt_id); - $pirep->flightnum = $flightinfo->flightnum; - $pirep->flighttime = 0; - $pirep->distance = 0; + $pirep->flightnum = $flightinfo->flightnum; + $pirep->flighttime = 0; + $pirep->distance = 0; $pirep->acars_client = 'manual'; - $pirep->route = "Manually Filed"; - $pirep->status = 0; - $pirep->landingrate = $request->input('landingrate'); + $pirep->route = 'Manually Filed'; + $pirep->status = 0; + $pirep->landingrate = $request->input('landingrate'); $pirep->save(); $flightinfo->delete(); $request->session()->flash('success', 'Manual PIREP submitted for manual approval.'); + return redirect('/flightops'); } + public function getLogbookDetailed($id) { $pirep = PIREP::where('id', $id)->with('airline')->with('depapt')->with('arrapt')->with('aircraft')->with('user')->first(); + return view('crewops.logbook.show', ['p' => $pirep]); } - function convertTime($dec) + public function convertTime($dec) { // start by converting to seconds $seconds = ($dec * 3600); @@ -190,11 +205,10 @@ function convertTime($dec) // return the time formatted HH:MM:SS //return lz($hours).":".lz($minutes).":".lz($seconds); return $hours; - } -// lz = leading zero - function lz($num) + // lz = leading zero + public function lz($num) { return (strlen($num) < 2) ? "0{$num}" : $num; } diff --git a/app/Http/Controllers/CrewOps/EventsController.php b/app/Http/Controllers/CrewOps/EventsController.php index bd68dc32..0af98565 100644 --- a/app/Http/Controllers/CrewOps/EventsController.php +++ b/app/Http/Controllers/CrewOps/EventsController.php @@ -3,7 +3,6 @@ namespace App\Http\Controllers\CrewOps; use App\Models\AirlineEvent; -use Illuminate\Http\Request; use App\Http\Controllers\Controller; use Illuminate\Support\Facades\Auth; @@ -13,25 +12,26 @@ public function index() { // get all the events in the system that are published and are public status. $events = AirlineEvent::where(['status' => 1, 'access' => 2])->where(['owner_id' => Auth::user()->id])->get(); + return view('crewops.events.view', ['events' => $events]); } + public function view($url_slug) { - try - { + try { $event = AirlineEvent::firstOrFail('url_slug', $url_slug)->with('flights'); - } - catch (Exception $e) - { + } catch (Exception $e) { return view('errors.404'); } - return view('crewops.events.show', ['event', $event]); + return view('crewops.events.show', ['event', $event]); } + public function create() { // } + public function store() { // diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php index a3af7dd8..26d46355 100644 --- a/app/Http/Controllers/HomeController.php +++ b/app/Http/Controllers/HomeController.php @@ -2,8 +2,6 @@ namespace App\Http\Controllers; -use Illuminate\Http\Request; - class HomeController extends Controller { /** diff --git a/app/Http/Controllers/LegacyACARS/smartCARS.php b/app/Http/Controllers/LegacyACARS/smartCARS.php index d23ebb16..84a55148 100644 --- a/app/Http/Controllers/LegacyACARS/smartCARS.php +++ b/app/Http/Controllers/LegacyACARS/smartCARS.php @@ -2,15 +2,13 @@ namespace App\Http\Controllers\LegacyACARS; -use Illuminate\Http\Request; -use App\Http\Controllers\Controller; -use App\Models\Airline; use App\User; use App\Models\Flight; +use App\Models\Airline; use App\Models\ACARSData; +use Illuminate\Http\Request; use App\Models\FlightComment; -use Illuminate\Support\Facades\DB; - +use App\Http\Controllers\Controller; class smartCARS extends Controller { @@ -18,7 +16,7 @@ public function filePIREP(Request $request) { // first lets check to see if we have everything required for the request $input = $request->all(); - $data = array(); + $data = []; // First lets update financial data. @@ -32,21 +30,22 @@ public function filePIREP(Request $request) // This is a legacy ACARS client. Treat it with respect, they won't be around // for too much longer. All we need is the user data, flight info and we are all set - $pirep = Flight::find($request->input('legacyroute')); - $pirep->landingrate = $request->input('landingrate'); - $pirep->flighttime = $request->input('flighttime'); + $pirep = Flight::find($request->input('legacyroute')); + $pirep->landingrate = $request->input('landingrate'); + $pirep->flighttime = $request->input('flighttime'); $pirep->acars_client = $request->input('source'); - $pirep->fuel_used = $request->input('fuelused'); - $pirep->flight_data = $request->input('log'); - $pirep->state = 2; + $pirep->fuel_used = $request->input('fuelused'); + $pirep->flight_data = $request->input('log'); + $pirep->state = 2; // Auto Accept System if (env('VAOS_AA_ENABLED')) { - if ($request->input('landingrate') >= env('VAOS_AA_LR')) + if ($request->input('landingrate') >= env('VAOS_AA_LR')) { $pirep->status = 1; + } } - if (env('VAOS_AA_ALL')) + if (env('VAOS_AA_ALL')) { $pirep->status = 1; - + } $pirep->save(); // now let's take care of comments. @@ -58,17 +57,17 @@ public function filePIREP(Request $request) $comment->save(); return response()->json([ - 'status' => 200 + 'status' => 200, ]); } + public function positionreport(Request $request) { - $report = array(); + $report = []; // First off, lets establish the format. Is this phpvms? - if ($request->query('format') == 'phpVMS') - { + if ($request->query('format') == 'phpVMS') { // well shoot, we got a legacy ACARS client. Let's sterilize the data and format the input. - $report['user'] = User::find($request->input('pilotid'))->id; + $report['user'] = User::find($request->input('pilotid'))->id; $report['user_id'] = $request->input('pilotid'); // split the flight string the phpVMS way into Airline Code and Flight Number. // Why they did this is beyond me. Foreign keys are another story..... @@ -79,23 +78,21 @@ public function positionreport(Request $request) //$report['aircraft'] = Aircraft::where('registration', $request->input('registration'))->first(); $report['lat'] = $request->input('lat'); // Lets convert lng to lon. Play with the big boys now - $report['lon'] = $request->input('lng'); - $report['heading'] = $request->input('heading'); - $report['altitude'] = $request->input('alt'); - $report['groundspeed'] = $request->input('gs'); - $report['distremain'] = $request->input('distremain'); + $report['lon'] = $request->input('lng'); + $report['heading'] = $request->input('heading'); + $report['altitude'] = $request->input('alt'); + $report['groundspeed'] = $request->input('gs'); + $report['distremain'] = $request->input('distremain'); $report['timeremaining'] = $request->input('timeremaining'); - $report['online'] = $request->input('online'); + $report['online'] = $request->input('online'); /* 'deptime' 'arrtime' 'route' */ - $report['phase'] = $request->input('phasedetail'); + $report['phase'] = $request->input('phasedetail'); $report['client'] = $request->input('client'); - } - else - { + } else { return response()->json([ 'status' => 800, ]); @@ -104,54 +101,61 @@ public function positionreport(Request $request) $rpt = ACARSData::new(); $rpt->user()->associate($report['user']); $rpt->bid()->associate($report['bid']); - $rpt->lat = $report['lat']; - $rpt->lon = $report['lon']; - $rpt->heading = $report['heading']; - $rpt->altitude = $report['altitude']; - $rpt->groundspeed = $report['groundspeed']; - $rpt->phase = $report['phase']; - $rpt->client = $report['client']; - $rpt->distremain = $report['distremain']; + $rpt->lat = $report['lat']; + $rpt->lon = $report['lon']; + $rpt->heading = $report['heading']; + $rpt->altitude = $report['altitude']; + $rpt->groundspeed = $report['groundspeed']; + $rpt->phase = $report['phase']; + $rpt->client = $report['client']; + $rpt->distremain = $report['distremain']; $rpt->timeremaining = $report['timeremaining']; - $rpt->online = $report['online']; + $rpt->online = $report['online']; $rpt->save(); + return response()->json([ - 'status' => 200 + 'status' => 200, ]); } + public function getBids($user_id) { $flights = Flight::where(['user_id' => $user_id, ['state', '<=', 1]])->with('depapt')->with('arrapt')->with('airline')->with('aircraft')->get(); - $export = array(); + $export = []; //dd($flights); $c = 0; foreach ($flights as $flight) { - $export[$c]['bidid'] = $flight['id']; - $export[$c]['routeid'] = $flight['id']; - $export[$c]['code'] = $flight['airline']['icao']; - $export[$c]['flightnumber'] = $flight['flightnum']; - $export[$c]['type'] = "P"; - $export[$c]['departureicao'] = $flight['depapt']['icao']; - $export[$c]['arrivalicao'] = $flight['arrapt']['icao']; - $export[$c]['route'] = $flight['route']; - $export[$c]['cruisingaltitude'] = "35000"; - $export[$c]['aircraft'] = $flight['aircraft_id']; - $export[$c]['duration'] = '0.00'; - $export[$c]['departuretime'] = $flight['deptime']; - $export[$c]['arrivaltime'] = $flight['arrtime']; - $export[$c]['load'] = '0'; - $export[$c]['daysofweek'] = "0123456"; + $export[$c]['bidid'] = $flight['id']; + $export[$c]['routeid'] = $flight['id']; + $export[$c]['code'] = $flight['airline']['icao']; + $export[$c]['flightnumber'] = $flight['flightnum']; + $export[$c]['type'] = 'P'; + $export[$c]['departureicao'] = $flight['depapt']['icao']; + $export[$c]['arrivalicao'] = $flight['arrapt']['icao']; + $export[$c]['route'] = $flight['route']; + $export[$c]['cruisingaltitude'] = '35000'; + $export[$c]['aircraft'] = $flight['aircraft_id']; + $export[$c]['duration'] = '0.00'; + $export[$c]['departuretime'] = $flight['deptime']; + $export[$c]['arrivaltime'] = $flight['arrtime']; + $export[$c]['load'] = '0'; + $export[$c]['daysofweek'] = '0123456'; // Iterate through the array $c++; } + return response()->json($export); } - private static function getProperFlightNum($flightnum, $userid) { - if ($flightnum == '') return false; - $ret = array(); + private static function getProperFlightNum($flightnum, $userid) + { + if ($flightnum == '') { + return false; + } + + $ret = []; $flightnum = strtoupper($flightnum); - $airlines = Airline::all(); + $airlines = Airline::all(); foreach ($airlines as $a) { $a->icao = strtoupper($a->icao); @@ -160,18 +164,18 @@ private static function getProperFlightNum($flightnum, $userid) { continue; } - $ret['icao'] = $a->icao; + $ret['icao'] = $a->icao; $ret['flightnum'] = str_ireplace($a->icao, '', $flightnum); // ok now that we deduced that, let's find the bid. //dd($userid); return Flight::where(['user_id' => $userid, 'airline_id' => $a->id, 'flightnum' => $ret['flightnum']])->first(); - } - # Invalid flight number - $ret['code'] = ''; + // Invalid flight number + $ret['code'] = ''; $ret['flightnum'] = $flightnum; + return Flight::where(['user_id' => $userid, 'flightnum' => $ret['flightnum']])->first(); } } diff --git a/app/Http/Controllers/LegacyACARS/xacars.php b/app/Http/Controllers/LegacyACARS/xacars.php index cc262875..e134f24e 100644 --- a/app/Http/Controllers/LegacyACARS/xacars.php +++ b/app/Http/Controllers/LegacyACARS/xacars.php @@ -2,7 +2,6 @@ namespace App\Http\Controllers\LegacyACARS; -use Illuminate\Http\Request; use App\Http\Controllers\Controller; class xacars extends Controller diff --git a/app/Http/Controllers/OnlineData/VatsimData.php b/app/Http/Controllers/OnlineData/VatsimData.php index 753efbce..11534ac7 100644 --- a/app/Http/Controllers/OnlineData/VatsimData.php +++ b/app/Http/Controllers/OnlineData/VatsimData.php @@ -2,10 +2,9 @@ namespace App\Http\Controllers\OnlineData; -use App\Models\ACARSData; use App\Models\Flight; use GuzzleHttp\Client; -use Illuminate\Http\Request; +use App\Models\ACARSData; use App\Http\Controllers\Controller; class VatsimData extends Controller @@ -14,14 +13,13 @@ public function updateAll() { $allFlights = Flight::active()->filed()->with('airline')->get(); - foreach ($allFlights as $flight) - { + foreach ($allFlights as $flight) { $flight->combi = $flight->airline->icao.$flight->flightnum; //dd($flight); } // get the VATSIM data text file. $client = new Client(); - $res = $client->request('GET', 'http://info.vroute.net/vatsim-data.txt', [ + $res = $client->request('GET', 'http://info.vroute.net/vatsim-data.txt', [ ])->getBody(); @@ -30,21 +28,18 @@ public function updateAll() // Get a list of active flights in our system and let's find the flights on the VATSIM status - foreach($allFlights as $flight) - { - foreach($data_lines as $line) - { - if (strpos($line, $flight->combi) !== false) - { + foreach ($allFlights as $flight) { + foreach ($data_lines as $line) { + if (strpos($line, $flight->combi) !== false) { // Awesome, we found the flight. Now we need to split the array out and store the data. $data = explode(':', $line); // double check if it's a pre-file or not. If so, don't do anything. - if($data[5] === null) + if ($data[5] === null) { break; + } // Let's check the state of the flight. If it's filed, we need to set it as active - if ($flight->state = 0) - { + if ($flight->state = 0) { $flight->state = 1; } @@ -52,24 +47,24 @@ public function updateAll() $rpt = new ACARSData(); $rpt->user()->associate($flight->user->id); $rpt->bid()->associate($flight); - $rpt->lat = $data[5]; - $rpt->lon = $data[6]; - $rpt->heading = $data[38]; - $rpt->altitude = $data[7]; - $rpt->groundspeed = $data[8]; - $rpt->phase = "N/A"; - $rpt->online = true; + $rpt->lat = $data[5]; + $rpt->lon = $data[6]; + $rpt->heading = $data[38]; + $rpt->altitude = $data[7]; + $rpt->groundspeed = $data[8]; + $rpt->phase = 'N/A'; + $rpt->online = true; $rpt->timeremaining = '0'; - $rpt->client = 'vatsim'; + $rpt->client = 'vatsim'; $rpt->save(); // update the flight with the current tracking information. unset($flight['combi']); - $flight->lat = $data[5]; - $flight->lon = $data[6]; - $flight->heading = $data[38]; + $flight->lat = $data[5]; + $flight->lon = $data[6]; + $flight->heading = $data[38]; $flight->altitude = $data[7]; - $flight->gs = $data[8]; + $flight->gs = $data[8]; $flight->save(); break; } @@ -79,6 +74,6 @@ public function updateAll() // ok that's all the active flights. Now just in case, let's double check to see if we can find any aircraft // that our members have in their personal fleet being flown, add those flights to the system. - return "ok"; + return 'ok'; } } diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php index ac0012f9..08ce2df6 100644 --- a/app/Http/Kernel.php +++ b/app/Http/Kernel.php @@ -46,12 +46,12 @@ class Kernel extends HttpKernel * @var array */ protected $routeMiddleware = [ - 'auth' => \Illuminate\Auth\Middleware\Authenticate::class, + 'auth' => \Illuminate\Auth\Middleware\Authenticate::class, 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class, - 'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class, + 'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class, //'acl' => 'Kodeine\Acl\Middleware\HasPermission', - 'can' => \Illuminate\Auth\Middleware\Authorize::class, - 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class, + 'can' => \Illuminate\Auth\Middleware\Authorize::class, + 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class, 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, ]; } diff --git a/app/Http/Middleware/ActiveAccountCheck.php b/app/Http/Middleware/ActiveAccountCheck.php index 19900d55..75e7ba1e 100644 --- a/app/Http/Middleware/ActiveAccountCheck.php +++ b/app/Http/Middleware/ActiveAccountCheck.php @@ -4,7 +4,6 @@ use Closure; use Illuminate\Support\Facades\Auth; -use Illuminate\Support\Facades\Session; class ActiveAccountCheck { @@ -13,22 +12,23 @@ class ActiveAccountCheck * * @param \Illuminate\Http\Request $request * @param \Closure $next + * * @return mixed */ public function handle($request, Closure $next) { - if (Auth::user()->status == 0) - { + if (Auth::user()->status == 0) { $request->session()->flash('AppInProgress', true); Auth::logout(); + return redirect('/login'); - } - else if (Auth::user()->status == 2) - { + } elseif (Auth::user()->status == 2) { $request->session()->flash('AccountDisabled', true); Auth::logout(); + return redirect('/login'); } + return $next($request); } } diff --git a/app/Http/Middleware/AdminPerms.php b/app/Http/Middleware/AdminPerms.php index 8710acba..45d68ad4 100644 --- a/app/Http/Middleware/AdminPerms.php +++ b/app/Http/Middleware/AdminPerms.php @@ -4,6 +4,7 @@ use Closure; use Illuminate\Support\Facades\Auth; + class AdminPerms { /** @@ -11,13 +12,16 @@ class AdminPerms * * @param \Illuminate\Http\Request $request * @param \Closure $next + * * @return mixed */ public function handle($request, Closure $next) { // Check if the user is an admin. If not, deny him. - if (!Auth::user()->admin) + if (! Auth::user()->admin) { abort(403, 'Account does not have admin permissions'); + } + return $next($request); } } diff --git a/app/Http/Middleware/AirlineInsert.php b/app/Http/Middleware/AirlineInsert.php index 56df263e..56a7cecb 100644 --- a/app/Http/Middleware/AirlineInsert.php +++ b/app/Http/Middleware/AirlineInsert.php @@ -2,8 +2,8 @@ namespace App\Http\Middleware; -use App\Models\Airline; use Closure; +use App\Models\Airline; class AirlineInsert { @@ -12,6 +12,7 @@ class AirlineInsert * * @param \Illuminate\Http\Request $request * @param \Closure $next + * * @return mixed */ public function handle($request, Closure $next) @@ -20,12 +21,11 @@ public function handle($request, Closure $next) try { $airline = Airline::where('url_slug', $params['airline'])->firstOrFail(); - } - catch (Exception $e) - { + } catch (Exception $e) { return response()->view('error.404'); } $request->attributes->add(['airline' => $airline]); + return $next($request); } } diff --git a/app/Http/Middleware/Auth1_0.php b/app/Http/Middleware/Auth1_0.php index bce0772a..f3783bab 100644 --- a/app/Http/Middleware/Auth1_0.php +++ b/app/Http/Middleware/Auth1_0.php @@ -2,8 +2,8 @@ namespace App\Http\Middleware; -use App\ACARS_Session; use Closure; +use App\ACARS_Session; class APIAuth1_0 { @@ -12,21 +12,21 @@ class APIAuth1_0 * * @param \Illuminate\Http\Request $request * @param \Closure $next + * * @return mixed */ public function handle($request, Closure $next) { // Check to see if we are handling Session Based Authentication - if ($request->auth = 'session') - { + if ($request->auth = 'session') { $res = ACARS_Session::where('userid', $request->userid)->first(); // They failed session authentication. - if (!$res) - { + if (! $res) { return json_encode(['status' => 503]); } } + return $next($request); } } diff --git a/app/Http/Middleware/PermCheck.php b/app/Http/Middleware/PermCheck.php index a8518084..f060b72d 100644 --- a/app/Http/Middleware/PermCheck.php +++ b/app/Http/Middleware/PermCheck.php @@ -11,6 +11,7 @@ class PermCheck * * @param \Illuminate\Http\Request $request * @param \Closure $next + * * @return mixed */ public function handle($request, Closure $next) diff --git a/app/Http/Middleware/RedirectIfAuthenticated.php b/app/Http/Middleware/RedirectIfAuthenticated.php index 7f184058..6cd4aaef 100644 --- a/app/Http/Middleware/RedirectIfAuthenticated.php +++ b/app/Http/Middleware/RedirectIfAuthenticated.php @@ -13,6 +13,7 @@ class RedirectIfAuthenticated * @param \Illuminate\Http\Request $request * @param \Closure $next * @param string|null $guard + * * @return mixed */ public function handle($request, Closure $next, $guard = null) diff --git a/app/Mail/FlightCreated.php b/app/Mail/FlightCreated.php index 0b9560b1..8aad223b 100644 --- a/app/Mail/FlightCreated.php +++ b/app/Mail/FlightCreated.php @@ -5,7 +5,6 @@ use Illuminate\Bus\Queueable; use Illuminate\Mail\Mailable; use Illuminate\Queue\SerializesModels; -use Illuminate\Contracts\Queue\ShouldQueue; class FlightCreated extends Mailable { diff --git a/app/Mail/FlightDeleted.php b/app/Mail/FlightDeleted.php index 1d7751e8..1fce30a4 100644 --- a/app/Mail/FlightDeleted.php +++ b/app/Mail/FlightDeleted.php @@ -5,7 +5,6 @@ use Illuminate\Bus\Queueable; use Illuminate\Mail\Mailable; use Illuminate\Queue\SerializesModels; -use Illuminate\Contracts\Queue\ShouldQueue; class FlightDeleted extends Mailable { diff --git a/app/Mail/FlightPending.php b/app/Mail/FlightPending.php index fb0c1915..e32cdf99 100644 --- a/app/Mail/FlightPending.php +++ b/app/Mail/FlightPending.php @@ -5,7 +5,6 @@ use Illuminate\Bus\Queueable; use Illuminate\Mail\Mailable; use Illuminate\Queue\SerializesModels; -use Illuminate\Contracts\Queue\ShouldQueue; class FlightPending extends Mailable { diff --git a/app/Mail/FlightUpdated.php b/app/Mail/FlightUpdated.php index b00e0639..f5229f93 100644 --- a/app/Mail/FlightUpdated.php +++ b/app/Mail/FlightUpdated.php @@ -5,7 +5,6 @@ use Illuminate\Bus\Queueable; use Illuminate\Mail\Mailable; use Illuminate\Queue\SerializesModels; -use Illuminate\Contracts\Queue\ShouldQueue; class FlightUpdated extends Mailable { diff --git a/app/Mail/UserApplicationAccepted.php b/app/Mail/UserApplicationAccepted.php index ad6ecd04..e4dac45f 100644 --- a/app/Mail/UserApplicationAccepted.php +++ b/app/Mail/UserApplicationAccepted.php @@ -5,7 +5,6 @@ use Illuminate\Bus\Queueable; use Illuminate\Mail\Mailable; use Illuminate\Queue\SerializesModels; -use Illuminate\Contracts\Queue\ShouldQueue; class UserApplicationAccepted extends Mailable { diff --git a/app/Mail/UserApplicationDenied.php b/app/Mail/UserApplicationDenied.php index 9f517f67..217c224c 100644 --- a/app/Mail/UserApplicationDenied.php +++ b/app/Mail/UserApplicationDenied.php @@ -5,7 +5,6 @@ use Illuminate\Bus\Queueable; use Illuminate\Mail\Mailable; use Illuminate\Queue\SerializesModels; -use Illuminate\Contracts\Queue\ShouldQueue; class UserApplicationDenied extends Mailable { diff --git a/app/Mail/UserApplicationReceived.php b/app/Mail/UserApplicationReceived.php index 1818f49a..804ae504 100644 --- a/app/Mail/UserApplicationReceived.php +++ b/app/Mail/UserApplicationReceived.php @@ -5,7 +5,6 @@ use Illuminate\Bus\Queueable; use Illuminate\Mail\Mailable; use Illuminate\Queue\SerializesModels; -use Illuminate\Contracts\Queue\ShouldQueue; class UserApplicationReceived extends Mailable { diff --git a/app/Models/ACARSData.php b/app/Models/ACARSData.php index 2a9c30cf..33785eef 100644 --- a/app/Models/ACARSData.php +++ b/app/Models/ACARSData.php @@ -6,12 +6,14 @@ class ACARSData extends Model { - protected $table = 'acarsdata'; + protected $table = 'acarsdata'; protected $guarded = []; + public function user() { return $this->belongsTo('App\User'); } + public function bid() { return $this->belongsTo('App\Models\Flight'); diff --git a/app/Models/Aircraft.php b/app/Models/Aircraft.php index 6eb33a5e..c1960b00 100644 --- a/app/Models/Aircraft.php +++ b/app/Models/Aircraft.php @@ -12,33 +12,39 @@ public function hub() { return $this->belongsTo('App\Models\Hub'); } + public function location() { return $this->belongsTo('App\Models\Airport'); } + public function airline() { return $this->belongsTo('App\Models\Airline'); } + public function aircraft_group() { return $this->belongsToMany('App\Models\AircraftGroup', 'aircraft_group_pivot'); } + public function type_rating() { return $this->belongsTo('App\Models\TypeRating'); } + public function flights() { return $this->hasMany('App\Models\Flight'); } + public function isAvailable() { $active = $this->flights()->filed()->active()->get(); - if ($active->isEmpty()) - { + if ($active->isEmpty()) { return true; } + return false; } } diff --git a/app/Models/AircraftGroup.php b/app/Models/AircraftGroup.php index 3378fd47..cf7cf052 100644 --- a/app/Models/AircraftGroup.php +++ b/app/Models/AircraftGroup.php @@ -9,22 +9,24 @@ class AircraftGroup extends Model // public $table = 'aircraft_groups'; - protected $fillable = array('name', 'icao', 'userdefined'); + protected $fillable = ['name', 'icao', 'userdefined']; public function aircraft() { return $this->belongsToMany('App\Models\Aircraft', 'aircraft_group_pivot'); } + public function airline() { return $this->belongsTo('App\Models\Airline'); } + public function schedule() { return $this->belongsToMany('App\Models\Schedule'); } + public function isAvailable($aircraft_id) { - } } diff --git a/app/Models/Airline.php b/app/Models/Airline.php index 1a3b1d41..aa81309e 100644 --- a/app/Models/Airline.php +++ b/app/Models/Airline.php @@ -19,7 +19,7 @@ class Airline extends Model 'isAccepting', 'autoAdd', 'aaEnabled', - 'aaLandingRate' + 'aaLandingRate', ]; public $timestamps = false; diff --git a/app/Models/AirlineEvent.php b/app/Models/AirlineEvent.php index c743d8ad..8df4dc5a 100644 --- a/app/Models/AirlineEvent.php +++ b/app/Models/AirlineEvent.php @@ -10,10 +10,12 @@ public function users() { return $this->belongsToMany('App\User')->withPivot(['status', 'role']); } + public function airline() { return $this->belongsTo('App\Models\Airline'); } + public function flights() { return $this->hasMany('App\Models\AirlineEventFlight'); diff --git a/app/Models/AirlineEventFlight.php b/app/Models/AirlineEventFlight.php index b0b35451..553067a8 100644 --- a/app/Models/AirlineEventFlight.php +++ b/app/Models/AirlineEventFlight.php @@ -10,18 +10,22 @@ public function airline() { return $this->belongsTo('App\Models\Airline'); } + public function depapt() { return $this->belongsTo('App\Models\Airport'); } + public function arrapt() { return $this->belongsTo('App\Models\Airport'); } + public function aircraft_group() { return $this->belongsToMany('App\Models\AircraftGroup'); } + public function aircraft() { return $this->belongsToMany('App\Models\Aircraft'); diff --git a/app/Models/Airport.php b/app/Models/Airport.php index e0a20b6a..98f4c32f 100644 --- a/app/Models/Airport.php +++ b/app/Models/Airport.php @@ -13,9 +13,9 @@ public function schedules() { return $this->hasMany('App\ScheduleTemplate'); } + public function users() { return $this->hasMany('App\User'); } - } diff --git a/app/Models/Flight.php b/app/Models/Flight.php index 4afa3fd3..aa10a66c 100644 --- a/app/Models/Flight.php +++ b/app/Models/Flight.php @@ -15,22 +15,27 @@ public function user() { return $this->belongsTo('App\User'); } + public function airline() { return $this->belongsTo('App\Models\Airline'); } + public function depapt() { return $this->belongsTo('App\Models\Airport'); } + public function arrapt() { return $this->belongsTo('App\Models\Airport'); } + public function aircraft() { return $this->belongsTo('App\Models\Aircraft'); } + public function flight_data() { return $this->hasMany('App\Models\ACARSData'); @@ -40,13 +45,14 @@ public function scopeFiled($query) { return $query->where('state', 0); } + public function scopeActive($query) { return $query->where('state', 1); } + public function scopeCompleted($query) { return $query->where('state', 2); } - } diff --git a/app/Models/Hub.php b/app/Models/Hub.php index 4d17ddce..a4b0b9d6 100644 --- a/app/Models/Hub.php +++ b/app/Models/Hub.php @@ -10,10 +10,12 @@ public function airport() { return $this->hasOne('App\Models\Airport'); } + public function airline() { return $this->belongsTo('App\Models\Airline'); } + public function user() { return $this->hasMany('App\User'); diff --git a/app/Models/LogbookComment.php b/app/Models/LogbookComment.php index 24c79419..03b9ce15 100644 --- a/app/Models/LogbookComment.php +++ b/app/Models/LogbookComment.php @@ -6,11 +6,11 @@ class FlightComment extends Model { - public function user() { return $this->belongsTo('App\User'); } + public function flight() { return $this->belongsTo('App\Models\Flight'); diff --git a/app/Models/LogbookEntry.php b/app/Models/LogbookEntry.php index 0553145c..c0f85636 100644 --- a/app/Models/LogbookEntry.php +++ b/app/Models/LogbookEntry.php @@ -7,27 +7,33 @@ class LogbookEntry extends Model { protected $guarded = []; - public $table = 'pireps'; + public $table = 'pireps'; + public function user() { return $this->belongsTo('App\User'); } + public function airline() { return $this->belongsTo('App\Models\Airline'); } + public function depapt() { return $this->belongsTo('App\Models\Airport'); } + public function arrapt() { return $this->belongsTo('App\Models\Airport'); } + public function aircraft() { return $this->belongsTo('App\Models\Aircraft'); } + public function acarsdata() { return $this->hasMany('App\Models\ACARSData'); diff --git a/app/Models/Schedule.php b/app/Models/Schedule.php index 56f7a101..d35fe929 100644 --- a/app/Models/Schedule.php +++ b/app/Models/Schedule.php @@ -6,28 +6,33 @@ class Schedule extends Model { - public $table = "schedules"; + public $table = 'schedules'; public function airline() { return $this->belongsTo('App\Models\Airline'); } + public function depapt() { return $this->belongsTo('App\Models\Airport'); } + public function arrapt() { return $this->belongsTo('App\Models\Airport'); } + public function aircraft_group() { return $this->belongsToMany('App\Models\AircraftGroup')->withPivot('primary'); } + public function aircraft() { return $this->belongsToMany('App\Models\Aircraft')->withPivot('primary'); } + // Eloquent Eger Loading Helper public static function allFK() { diff --git a/app/Models/TypeRating.php b/app/Models/TypeRating.php index 18344705..a6cd798a 100644 --- a/app/Models/TypeRating.php +++ b/app/Models/TypeRating.php @@ -10,14 +10,17 @@ public function user() { return $this->belongsToMany('App\User'); } + public function airline() { return $this->belongsTo('App\Models\Airline'); } + public function aircraft() { return $this->belongsToMany('App\Models\Aircraft'); } + public function aircraft_groups() { return $this->belongsToMany('App\Models\AircraftGroup'); diff --git a/app/Notifications/PirepFiled.php b/app/Notifications/PirepFiled.php index 1a220c21..b857da67 100644 --- a/app/Notifications/PirepFiled.php +++ b/app/Notifications/PirepFiled.php @@ -4,39 +4,44 @@ use Illuminate\Bus\Queueable; use Illuminate\Notifications\Notification; -use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Notifications\Messages\MailMessage; -class PirepFiled extends Notification { - use Queueable; +class PirepFiled extends Notification +{ + use Queueable; - /** - * Create a new notification instance. - * - * @return void - */ - public function __construct() { - // - } + /** + * Create a new notification instance. + * + * @return void + */ + public function __construct() + { + // + } - /** - * Get the notification's delivery channels. - * - * @param mixed $notifiable - * @return array - */ - public function via($notifiable) { - return ['mail']; - } + /** + * Get the notification's delivery channels. + * + * @param mixed $notifiable + * + * @return array + */ + public function via($notifiable) + { + return ['mail']; + } - /** - * Get the mail representation of the notification. - * - * @param mixed $notifiable - * @return \Illuminate\Notifications\Messages\MailMessage - */ - public function toMail($notifiable) { - switch ($notifiable->status) { + /** + * Get the mail representation of the notification. + * + * @param mixed $notifiable + * + * @return \Illuminate\Notifications\Messages\MailMessage + */ + public function toMail($notifiable) + { + switch ($notifiable->status) { case 0: return (new MailMessage()) ->subject('Pilot Report Notification') @@ -57,17 +62,19 @@ public function toMail($notifiable) { break; } - } + } - /** - * Get the array representation of the notification. - * - * @param mixed $notifiable - * @return array - */ - public function toArray($notifiable) { - return [ + /** + * Get the array representation of the notification. + * + * @param mixed $notifiable + * + * @return array + */ + public function toArray($notifiable) + { + return [ // ]; - } + } } diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index 66b4b195..35471f6f 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -24,6 +24,5 @@ public function boot() public function register() { // - } } diff --git a/app/Providers/AuthServiceProvider.php b/app/Providers/AuthServiceProvider.php index 9784b1a3..9e68caa6 100644 --- a/app/Providers/AuthServiceProvider.php +++ b/app/Providers/AuthServiceProvider.php @@ -2,7 +2,6 @@ namespace App\Providers; -use Illuminate\Support\Facades\Gate; use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider; class AuthServiceProvider extends ServiceProvider diff --git a/app/Providers/DBSettingServiceProvider.php b/app/Providers/DBSettingServiceProvider.php index 8e14df49..466d164f 100644 --- a/app/Providers/DBSettingServiceProvider.php +++ b/app/Providers/DBSettingServiceProvider.php @@ -24,6 +24,5 @@ public function boot() public function register() { require_once app_path('Helpers/settings.php'); - } } diff --git a/app/Providers/EventServiceProvider.php b/app/Providers/EventServiceProvider.php index 89b22c20..d806ca34 100644 --- a/app/Providers/EventServiceProvider.php +++ b/app/Providers/EventServiceProvider.php @@ -15,27 +15,27 @@ class EventServiceProvider extends ServiceProvider protected $listen = [ 'App\Events\PirepFiled' => [ 'App\Listeners\DiscordNotification', - 'App\Listeners\EmailNotification' + 'App\Listeners\EmailNotification', ], 'App\Events\BidRequested' => [ 'App\Listeners\DiscordNotification', - 'App\Listeners\EmailNotification' + 'App\Listeners\EmailNotification', ], 'App\Events\BidModified' => [ 'App\Listeners\DiscordNotification', - 'App\Listeners\EmailNotification' + 'App\Listeners\EmailNotification', ], 'App\Events\BidRemoved' => [ 'App\Listeners\DiscordNotification', - 'App\Listeners\EmailNotification' + 'App\Listeners\EmailNotification', ], 'App\Events\AirlineEventPublished' => [ 'App\Listeners\DiscordNotification', - 'App\Listeners\EmailNotification' + 'App\Listeners\EmailNotification', ], 'App\Events\AirineEventDispatched' => [ 'App\Listeners\DiscordNotification', - 'App\Listeners\EmailNotification' + 'App\Listeners\EmailNotification', ], ]; diff --git a/app/Providers/RouteServiceProvider.php b/app/Providers/RouteServiceProvider.php index 87ffb05a..fcee1399 100644 --- a/app/Providers/RouteServiceProvider.php +++ b/app/Providers/RouteServiceProvider.php @@ -53,7 +53,7 @@ protected function mapWebRoutes() { Route::group([ 'middleware' => 'web', - 'namespace' => $this->namespace, + 'namespace' => $this->namespace, ], function ($router) { require base_path('routes/web.php'); }); @@ -70,8 +70,8 @@ protected function mapApiRoutes() { Route::group([ 'middleware' => 'api', - 'namespace' => $this->namespace, - 'prefix' => 'api', + 'namespace' => $this->namespace, + 'prefix' => 'api', ], function ($router) { require base_path('routes/api.php'); }); diff --git a/app/User.php b/app/User.php index 0c076a77..6a99335d 100644 --- a/app/User.php +++ b/app/User.php @@ -4,7 +4,6 @@ use Illuminate\Notifications\Notifiable; use Illuminate\Foundation\Auth\User as Authenticatable; -use Kodeine\Acl\Traits\HasRole; class User extends Authenticatable { @@ -16,7 +15,7 @@ class User extends Authenticatable * @var array */ protected $fillable = [ - 'first_name', 'last_name', 'username', 'email', 'password', 'vatsim', 'ivao', 'status', 'admin' + 'first_name', 'last_name', 'username', 'email', 'password', 'vatsim', 'ivao', 'status', 'admin', ]; /** @@ -32,15 +31,19 @@ public function pirep() { return $this->hasMany('App\Models\Flight'); } + public function group() { return $this->belongsToMany('App\Models\Group'); } + public function airlines() { return $this->belongsToMany('App\Models\Airline')->withPivot('pilot_id', 'status', 'primary', 'admin'); } - public function hasAirline($airline) { + + public function hasAirline($airline) + { return $this->airlines->contains($airline); } } diff --git a/config/acl.php b/config/acl.php index 72c6c1d6..2115395e 100644 --- a/config/acl.php +++ b/config/acl.php @@ -2,7 +2,7 @@ return [ - /** + /* * Model definitions. * If you want to use your own model and extend it * to package's model. You can define your model here. @@ -11,7 +11,7 @@ 'role' => 'Kodeine\Acl\Models\Eloquent\Role', 'permission' => 'Kodeine\Acl\Models\Eloquent\Permission', - /** + /* * Most Permissive Wins right * If you have multiple permission aliases assigned, each alias * has a common permission, view.house => false, but one alias @@ -21,10 +21,10 @@ 'most_permissive_wins' => false, - /** + /* * Cache Minutes * Set the minutes that roles and permissions will be cached. */ - + 'cacheMinutes' => 1, ]; diff --git a/config/apiguard.php b/config/apiguard.php index 2fa9d474..3a203301 100644 --- a/config/apiguard.php +++ b/config/apiguard.php @@ -97,7 +97,7 @@ | Specify the provider that is used to authenticate users. | */ - 'auth' => Chrisbjr\ApiGuard\Providers\Auth\Illuminate::class + 'auth' => Chrisbjr\ApiGuard\Providers\Auth\Illuminate::class, ], diff --git a/config/app.php b/config/app.php index 514201c1..7604706e 100644 --- a/config/app.php +++ b/config/app.php @@ -14,7 +14,6 @@ 'name' => env('VAOS_ORG_NAME', 'VAOS'), - /* |-------------------------------------------------------------------------- | VAOS Version @@ -39,7 +38,6 @@ 'env' => env('APP_ENV', 'production'), - /* |-------------------------------------------------------------------------- | Application Debug Mode @@ -176,7 +174,6 @@ Illuminate\Validation\ValidationServiceProvider::class, Illuminate\View\ViewServiceProvider::class, - /* * Package Service Providers... */ @@ -213,43 +210,43 @@ 'aliases' => [ - 'App' => Illuminate\Support\Facades\App::class, - 'Artisan' => Illuminate\Support\Facades\Artisan::class, - 'Auth' => Illuminate\Support\Facades\Auth::class, - 'Blade' => Illuminate\Support\Facades\Blade::class, - 'Bus' => Illuminate\Support\Facades\Bus::class, - 'Cache' => Illuminate\Support\Facades\Cache::class, - 'Config' => Illuminate\Support\Facades\Config::class, - 'Cookie' => Illuminate\Support\Facades\Cookie::class, - 'Crypt' => Illuminate\Support\Facades\Crypt::class, - 'DB' => Illuminate\Support\Facades\DB::class, - 'Eloquent' => Illuminate\Database\Eloquent\Model::class, - 'Event' => Illuminate\Support\Facades\Event::class, - 'File' => Illuminate\Support\Facades\File::class, - 'Gate' => Illuminate\Support\Facades\Gate::class, - 'Hash' => Illuminate\Support\Facades\Hash::class, - 'Lang' => Illuminate\Support\Facades\Lang::class, - 'Log' => Illuminate\Support\Facades\Log::class, - 'Mail' => Illuminate\Support\Facades\Mail::class, + 'App' => Illuminate\Support\Facades\App::class, + 'Artisan' => Illuminate\Support\Facades\Artisan::class, + 'Auth' => Illuminate\Support\Facades\Auth::class, + 'Blade' => Illuminate\Support\Facades\Blade::class, + 'Bus' => Illuminate\Support\Facades\Bus::class, + 'Cache' => Illuminate\Support\Facades\Cache::class, + 'Config' => Illuminate\Support\Facades\Config::class, + 'Cookie' => Illuminate\Support\Facades\Cookie::class, + 'Crypt' => Illuminate\Support\Facades\Crypt::class, + 'DB' => Illuminate\Support\Facades\DB::class, + 'Eloquent' => Illuminate\Database\Eloquent\Model::class, + 'Event' => Illuminate\Support\Facades\Event::class, + 'File' => Illuminate\Support\Facades\File::class, + 'Gate' => Illuminate\Support\Facades\Gate::class, + 'Hash' => Illuminate\Support\Facades\Hash::class, + 'Lang' => Illuminate\Support\Facades\Lang::class, + 'Log' => Illuminate\Support\Facades\Log::class, + 'Mail' => Illuminate\Support\Facades\Mail::class, 'Notification' => Illuminate\Support\Facades\Notification::class, - 'Password' => Illuminate\Support\Facades\Password::class, - 'Queue' => Illuminate\Support\Facades\Queue::class, - 'Redirect' => Illuminate\Support\Facades\Redirect::class, - 'Redis' => Illuminate\Support\Facades\Redis::class, - 'Request' => Illuminate\Support\Facades\Request::class, - 'Response' => Illuminate\Support\Facades\Response::class, - 'Route' => Illuminate\Support\Facades\Route::class, - 'Schema' => Illuminate\Support\Facades\Schema::class, - 'Session' => Illuminate\Support\Facades\Session::class, - 'Storage' => Illuminate\Support\Facades\Storage::class, - 'URL' => Illuminate\Support\Facades\URL::class, - 'Validator' => Illuminate\Support\Facades\Validator::class, - 'View' => Illuminate\Support\Facades\View::class, + 'Password' => Illuminate\Support\Facades\Password::class, + 'Queue' => Illuminate\Support\Facades\Queue::class, + 'Redirect' => Illuminate\Support\Facades\Redirect::class, + 'Redis' => Illuminate\Support\Facades\Redis::class, + 'Request' => Illuminate\Support\Facades\Request::class, + 'Response' => Illuminate\Support\Facades\Response::class, + 'Route' => Illuminate\Support\Facades\Route::class, + 'Schema' => Illuminate\Support\Facades\Schema::class, + 'Session' => Illuminate\Support\Facades\Session::class, + 'Storage' => Illuminate\Support\Facades\Storage::class, + 'URL' => Illuminate\Support\Facades\URL::class, + 'Validator' => Illuminate\Support\Facades\Validator::class, + 'View' => Illuminate\Support\Facades\View::class, 'ApiGuardAuth' => \Chrisbjr\ApiGuard\Facades\ApiGuardAuth::class, - 'Excel' => Maatwebsite\Excel\Facades\Excel::class, + 'Excel' => Maatwebsite\Excel\Facades\Excel::class, 'DotenvEditor' => Brotzka\DotenvEditor\DotenvEditorFacade::class, - 'Recaptcha' => Greggilbert\Recaptcha\Facades\Recaptcha::class, - + 'Recaptcha' => Greggilbert\Recaptcha\Facades\Recaptcha::class, + ], ]; diff --git a/config/auth.php b/config/auth.php index 78175010..a9264b4a 100644 --- a/config/auth.php +++ b/config/auth.php @@ -14,7 +14,7 @@ */ 'defaults' => [ - 'guard' => 'web', + 'guard' => 'web', 'passwords' => 'users', ], @@ -37,12 +37,12 @@ 'guards' => [ 'web' => [ - 'driver' => 'session', + 'driver' => 'session', 'provider' => 'users', ], 'api' => [ - 'driver' => 'token', + 'driver' => 'token', 'provider' => 'users', ], ], @@ -67,7 +67,7 @@ 'providers' => [ 'users' => [ 'driver' => 'eloquent', - 'model' => App\User::class, + 'model' => App\User::class, ], // 'users' => [ @@ -94,8 +94,8 @@ 'passwords' => [ 'users' => [ 'provider' => 'users', - 'table' => 'password_resets', - 'expire' => 60, + 'table' => 'password_resets', + 'expire' => 60, ], ], diff --git a/config/broadcasting.php b/config/broadcasting.php index 19a59bad..897e32b3 100644 --- a/config/broadcasting.php +++ b/config/broadcasting.php @@ -31,17 +31,17 @@ 'connections' => [ 'pusher' => [ - 'driver' => 'pusher', - 'key' => env('PUSHER_KEY'), - 'secret' => env('PUSHER_SECRET'), - 'app_id' => env('PUSHER_APP_ID'), + 'driver' => 'pusher', + 'key' => env('PUSHER_KEY'), + 'secret' => env('PUSHER_SECRET'), + 'app_id' => env('PUSHER_APP_ID'), 'options' => [ // ], ], 'redis' => [ - 'driver' => 'redis', + 'driver' => 'redis', 'connection' => 'default', ], diff --git a/config/cache.php b/config/cache.php index 1d3de874..db00601b 100644 --- a/config/cache.php +++ b/config/cache.php @@ -39,20 +39,20 @@ ], 'database' => [ - 'driver' => 'database', - 'table' => 'cache', + 'driver' => 'database', + 'table' => 'cache', 'connection' => null, ], 'file' => [ 'driver' => 'file', - 'path' => storage_path('framework/cache'), + 'path' => storage_path('framework/cache'), ], 'memcached' => [ - 'driver' => 'memcached', + 'driver' => 'memcached', 'persistent_id' => env('MEMCACHED_PERSISTENT_ID'), - 'sasl' => [ + 'sasl' => [ env('MEMCACHED_USERNAME'), env('MEMCACHED_PASSWORD'), ], @@ -61,15 +61,15 @@ ], 'servers' => [ [ - 'host' => env('MEMCACHED_HOST', '127.0.0.1'), - 'port' => env('MEMCACHED_PORT', 11211), + 'host' => env('MEMCACHED_HOST', '127.0.0.1'), + 'port' => env('MEMCACHED_PORT', 11211), 'weight' => 100, ], ], ], 'redis' => [ - 'driver' => 'redis', + 'driver' => 'redis', 'connection' => 'default', ], diff --git a/config/database.php b/config/database.php index fb20aa8f..4259b83e 100644 --- a/config/database.php +++ b/config/database.php @@ -47,50 +47,50 @@ 'connections' => [ 'sqlite' => [ - 'driver' => 'sqlite', + 'driver' => 'sqlite', 'database' => env('DB_DATABASE', database_path('database.sqlite')), - 'prefix' => env('DB_PREFIX'), + 'prefix' => env('DB_PREFIX'), ], 'mysql' => [ - 'driver' => 'mysql', - 'host' => env('DB_HOST', 'localhost'), - 'port' => env('DB_PORT', '3306'), - 'database' => env('DB_DATABASE', 'forge'), - 'username' => env('DB_USERNAME', 'forge'), - 'password' => env('DB_PASSWORD', ''), - 'charset' => 'utf8', + 'driver' => 'mysql', + 'host' => env('DB_HOST', 'localhost'), + 'port' => env('DB_PORT', '3306'), + 'database' => env('DB_DATABASE', 'forge'), + 'username' => env('DB_USERNAME', 'forge'), + 'password' => env('DB_PASSWORD', ''), + 'charset' => 'utf8', 'collation' => 'utf8_unicode_ci', - 'prefix' => env('DB_PREFIX'), - 'strict' => true, - 'engine' => null, + 'prefix' => env('DB_PREFIX'), + 'strict' => true, + 'engine' => null, ], 'phpVMS' => [ - 'driver' => 'mysql', - 'host' => env('LEGACY_HOST', 'localhost'), - 'port' => env('LEGACY_PORT', '3306'), - 'database' => env('LEGACY_DATABASE', 'forge'), - 'username' => env('LEGACY_USERNAME', 'forge'), - 'password' => env('LEGACY_PASSWORD', ''), - 'charset' => 'utf8', + 'driver' => 'mysql', + 'host' => env('LEGACY_HOST', 'localhost'), + 'port' => env('LEGACY_PORT', '3306'), + 'database' => env('LEGACY_DATABASE', 'forge'), + 'username' => env('LEGACY_USERNAME', 'forge'), + 'password' => env('LEGACY_PASSWORD', ''), + 'charset' => 'utf8', 'collation' => 'utf8_unicode_ci', - 'prefix' => env('LEGACY_PREFIX'), - 'strict' => true, - 'engine' => null, + 'prefix' => env('LEGACY_PREFIX'), + 'strict' => true, + 'engine' => null, ], 'pgsql' => [ - 'driver' => 'pgsql', - 'host' => env('DB_HOST', 'localhost'), - 'port' => env('DB_PORT', '5432'), + 'driver' => 'pgsql', + 'host' => env('DB_HOST', 'localhost'), + 'port' => env('DB_PORT', '5432'), 'database' => env('DB_DATABASE', 'forge'), 'username' => env('DB_USERNAME', 'forge'), 'password' => env('DB_PASSWORD', ''), - 'charset' => 'utf8', - 'prefix' => '', - 'schema' => 'public', - 'sslmode' => 'prefer', + 'charset' => 'utf8', + 'prefix' => '', + 'schema' => 'public', + 'sslmode' => 'prefer', ], ], @@ -124,9 +124,9 @@ 'cluster' => false, 'default' => [ - 'host' => env('REDIS_HOST', 'localhost'), + 'host' => env('REDIS_HOST', 'localhost'), 'password' => env('REDIS_PASSWORD', null), - 'port' => env('REDIS_PORT', 6379), + 'port' => env('REDIS_PORT', 6379), 'database' => 0, ], diff --git a/config/excel.php b/config/excel.php index 2ad12770..fdbc685c 100644 --- a/config/excel.php +++ b/config/excel.php @@ -1,8 +1,8 @@ array( + 'cache' => [ /* |-------------------------------------------------------------------------- @@ -29,24 +29,24 @@ | Cache settings |-------------------------------------------------------------------------- */ - 'settings' => array( + 'settings' => [ 'memoryCacheSize' => '32MB', - 'cacheTime' => 600 + 'cacheTime' => 600, - ), + ], /* |-------------------------------------------------------------------------- | Memcache settings |-------------------------------------------------------------------------- */ - 'memcache' => array( + 'memcache' => [ 'host' => 'localhost', 'port' => 11211, - ), + ], /* |-------------------------------------------------------------------------- @@ -54,10 +54,10 @@ |-------------------------------------------------------------------------- */ - 'dir' => storage_path('cache') - ), + 'dir' => storage_path('cache'), + ], - 'properties' => array( + 'properties' => [ 'creator' => 'Maatwebsite', 'lastModifiedBy' => 'Maatwebsite', 'title' => 'Spreadsheet', @@ -67,35 +67,35 @@ 'category' => 'Excel', 'manager' => 'Maatwebsite', 'company' => 'Maatwebsite', - ), + ], /* |-------------------------------------------------------------------------- | Sheets settings |-------------------------------------------------------------------------- */ - 'sheets' => array( + 'sheets' => [ /* |-------------------------------------------------------------------------- | Default page setup |-------------------------------------------------------------------------- */ - 'pageSetup' => array( + 'pageSetup' => [ 'orientation' => 'portrait', 'paperSize' => '9', 'scale' => '100', 'fitToPage' => false, 'fitToHeight' => true, 'fitToWidth' => true, - 'columnsToRepeatAtLeft' => array('', ''), - 'rowsToRepeatAtTop' => array(0, 0), + 'columnsToRepeatAtLeft' => ['', ''], + 'rowsToRepeatAtTop' => [0, 0], 'horizontalCentered' => false, 'verticalCentered' => false, 'printArea' => null, 'firstPageNumber' => null, - ), - ), + ], + ], /* |-------------------------------------------------------------------------- @@ -108,7 +108,7 @@ 'creator' => 'Maatwebsite', - 'csv' => array( + 'csv' => [ /* |-------------------------------------------------------------------------- | Delimiter @@ -142,10 +142,10 @@ |-------------------------------------------------------------------------- */ - 'use_bom' => false - ), + 'use_bom' => false, + ], - 'export' => array( + 'export' => [ /* |-------------------------------------------------------------------------- @@ -218,7 +218,7 @@ | Default sheet settings |-------------------------------------------------------------------------- */ - 'sheets' => array( + 'sheets' => [ /* |-------------------------------------------------------------------------- @@ -253,8 +253,8 @@ | Apply strict comparison when testing for null values in the array |-------------------------------------------------------------------------- */ - 'strictNullComparison' => false - ), + 'strictNullComparison' => false, + ], /* |-------------------------------------------------------------------------- @@ -262,7 +262,7 @@ |-------------------------------------------------------------------------- */ - 'store' => array( + 'store' => [ /* |-------------------------------------------------------------------------- @@ -282,16 +282,16 @@ | Whether we want to return information about the stored file or not | */ - 'returnInfo' => false + 'returnInfo' => false, - ), + ], /* |-------------------------------------------------------------------------- | PDF Settings |-------------------------------------------------------------------------- */ - 'pdf' => array( + 'pdf' => [ /* |-------------------------------------------------------------------------- @@ -306,48 +306,48 @@ | PDF Driver settings |-------------------------------------------------------------------------- */ - 'drivers' => array( + 'drivers' => [ /* |-------------------------------------------------------------------------- | DomPDF settings |-------------------------------------------------------------------------- */ - 'DomPDF' => array( - 'path' => base_path('vendor/dompdf/dompdf/') - ), + 'DomPDF' => [ + 'path' => base_path('vendor/dompdf/dompdf/'), + ], /* |-------------------------------------------------------------------------- | tcPDF settings |-------------------------------------------------------------------------- */ - 'tcPDF' => array( - 'path' => base_path('vendor/tecnick.com/tcpdf/') - ), + 'tcPDF' => [ + 'path' => base_path('vendor/tecnick.com/tcpdf/'), + ], /* |-------------------------------------------------------------------------- | mPDF settings |-------------------------------------------------------------------------- */ - 'mPDF' => array( - 'path' => base_path('vendor/mpdf/mpdf/') - ), - ) - ) - ), + 'mPDF' => [ + 'path' => base_path('vendor/mpdf/mpdf/'), + ], + ], + ], + ], - 'filters' => array( + 'filters' => [ /* |-------------------------------------------------------------------------- | Register read filters |-------------------------------------------------------------------------- */ - 'registered' => array( - 'chunk' => 'Maatwebsite\Excel\Filters\ChunkReadFilter' - ), + 'registered' => [ + 'chunk' => 'Maatwebsite\Excel\Filters\ChunkReadFilter', + ], /* |-------------------------------------------------------------------------- @@ -355,10 +355,10 @@ |-------------------------------------------------------------------------- */ - 'enabled' => array() - ), + 'enabled' => [], + ], - 'import' => array( + 'import' => [ /* |-------------------------------------------------------------------------- @@ -423,12 +423,12 @@ |-------------------------------------------------------------------------- */ - 'encoding' => array( + 'encoding' => [ 'input' => 'UTF-8', - 'output' => 'UTF-8' + 'output' => 'UTF-8', - ), + ], /* |-------------------------------------------------------------------------- @@ -474,7 +474,7 @@ | */ - 'dates' => array( + 'dates' => [ /* |-------------------------------------------------------------------------- @@ -498,15 +498,15 @@ | Date columns |-------------------------------------------------------------------------- */ - 'columns' => array() - ), + 'columns' => [], + ], /* |-------------------------------------------------------------------------- | Import sheets by config |-------------------------------------------------------------------------- */ - 'sheets' => array( + 'sheets' => [ /* |-------------------------------------------------------------------------- @@ -517,16 +517,16 @@ | */ - 'test' => array( + 'test' => [ - 'firstname' => 'A2' + 'firstname' => 'A2', - ) + ], - ) - ), + ], + ], - 'views' => array( + 'views' => [ /* |-------------------------------------------------------------------------- @@ -537,155 +537,155 @@ | */ - 'styles' => array( + 'styles' => [ /* |-------------------------------------------------------------------------- | Table headings |-------------------------------------------------------------------------- */ - 'th' => array( - 'font' => array( + 'th' => [ + 'font' => [ 'bold' => true, 'size' => 12, - ) - ), + ], + ], /* |-------------------------------------------------------------------------- | Strong tags |-------------------------------------------------------------------------- */ - 'strong' => array( - 'font' => array( + 'strong' => [ + 'font' => [ 'bold' => true, 'size' => 12, - ) - ), + ], + ], /* |-------------------------------------------------------------------------- | Bold tags |-------------------------------------------------------------------------- */ - 'b' => array( - 'font' => array( + 'b' => [ + 'font' => [ 'bold' => true, 'size' => 12, - ) - ), + ], + ], /* |-------------------------------------------------------------------------- | Italic tags |-------------------------------------------------------------------------- */ - 'i' => array( - 'font' => array( + 'i' => [ + 'font' => [ 'italic' => true, 'size' => 12, - ) - ), + ], + ], /* |-------------------------------------------------------------------------- | Heading 1 |-------------------------------------------------------------------------- */ - 'h1' => array( - 'font' => array( + 'h1' => [ + 'font' => [ 'bold' => true, 'size' => 24, - ) - ), + ], + ], /* |-------------------------------------------------------------------------- | Heading 2 |-------------------------------------------------------------------------- */ - 'h2' => array( - 'font' => array( + 'h2' => [ + 'font' => [ 'bold' => true, 'size' => 18, - ) - ), + ], + ], /* |-------------------------------------------------------------------------- | Heading 2 |-------------------------------------------------------------------------- */ - 'h3' => array( - 'font' => array( + 'h3' => [ + 'font' => [ 'bold' => true, 'size' => 13.5, - ) - ), + ], + ], /* |-------------------------------------------------------------------------- | Heading 4 |-------------------------------------------------------------------------- */ - 'h4' => array( - 'font' => array( + 'h4' => [ + 'font' => [ 'bold' => true, 'size' => 12, - ) - ), + ], + ], /* |-------------------------------------------------------------------------- | Heading 5 |-------------------------------------------------------------------------- */ - 'h5' => array( - 'font' => array( + 'h5' => [ + 'font' => [ 'bold' => true, 'size' => 10, - ) - ), + ], + ], /* |-------------------------------------------------------------------------- | Heading 6 |-------------------------------------------------------------------------- */ - 'h6' => array( - 'font' => array( + 'h6' => [ + 'font' => [ 'bold' => true, 'size' => 7.5, - ) - ), + ], + ], /* |-------------------------------------------------------------------------- | Hyperlinks |-------------------------------------------------------------------------- */ - 'a' => array( - 'font' => array( + 'a' => [ + 'font' => [ 'underline' => true, - 'color' => array('argb' => 'FF0000FF'), - ) - ), + 'color' => ['argb' => 'FF0000FF'], + ], + ], /* |-------------------------------------------------------------------------- | Horizontal rules |-------------------------------------------------------------------------- */ - 'hr' => array( - 'borders' => array( - 'bottom' => array( + 'hr' => [ + 'borders' => [ + 'bottom' => [ 'style' => 'thin', - 'color' => array('FF000000') - ), - ) - ) - ) + 'color' => ['FF000000'], + ], + ], + ], + ], - ) + ], -); +]; diff --git a/config/filesystems.php b/config/filesystems.php index 75b50022..7d0d0ed0 100644 --- a/config/filesystems.php +++ b/config/filesystems.php @@ -45,18 +45,18 @@ 'local' => [ 'driver' => 'local', - 'root' => storage_path('app'), + 'root' => storage_path('app'), ], 'public' => [ - 'driver' => 'local', - 'root' => storage_path('app/public'), + 'driver' => 'local', + 'root' => storage_path('app/public'), 'visibility' => 'public', ], 's3' => [ 'driver' => 's3', - 'key' => 'your-key', + 'key' => 'your-key', 'secret' => 'your-secret', 'region' => 'your-region', 'bucket' => 'your-bucket', diff --git a/config/installer.php b/config/installer.php index 890330f0..d8b7c902 100644 --- a/config/installer.php +++ b/config/installer.php @@ -16,7 +16,7 @@ 'openssl', 'pdo', 'mbstring', - 'tokenizer' + 'tokenizer', ], /* @@ -32,6 +32,6 @@ 'storage/app/' => '775', 'storage/framework/' => '775', 'storage/logs/' => '775', - 'bootstrap/cache/' => '775' - ] + 'bootstrap/cache/' => '775', + ], ]; diff --git a/config/mail.php b/config/mail.php index 518a3e1f..48f35a47 100644 --- a/config/mail.php +++ b/config/mail.php @@ -57,7 +57,7 @@ 'from' => [ 'address' => env('VAOS_ORG_EMAIL', 'noreply@flyspark.org'), - 'name' => env('VAOS_ORG_NAME', 'Spark Virtual'), + 'name' => env('VAOS_ORG_NAME', 'Spark Virtual'), ], /* diff --git a/config/modules.php b/config/modules.php index 508a80b8..1a7b803a 100644 --- a/config/modules.php +++ b/config/modules.php @@ -24,28 +24,28 @@ 'stubs' => [ 'enabled' => false, - 'path' => base_path() . '/vendor/nwidart/laravel-modules/src/Commands/stubs', - 'files' => [ - 'start' => 'start.php', - 'routes' => 'Http/routes.php', - 'views/index' => 'Resources/views/index.blade.php', - 'views/master' => 'Resources/views/layouts/master.blade.php', + 'path' => base_path().'/vendor/nwidart/laravel-modules/src/Commands/stubs', + 'files' => [ + 'start' => 'start.php', + 'routes' => 'Http/routes.php', + 'views/index' => 'Resources/views/index.blade.php', + 'views/master' => 'Resources/views/layouts/master.blade.php', 'scaffold/config' => 'Config/config.php', - 'composer' => 'composer.json', - 'assets/js/app' => 'Resources/assets/js/app.js', + 'composer' => 'composer.json', + 'assets/js/app' => 'Resources/assets/js/app.js', 'assets/sass/app' => 'Resources/assets/sass/app.scss', - 'webpack' => 'webpack.mix.js', - 'package' => 'package.json', + 'webpack' => 'webpack.mix.js', + 'package' => 'package.json', ], 'replacements' => [ - 'start' => ['LOWER_NAME', 'ROUTES_LOCATION'], - 'routes' => ['LOWER_NAME', 'STUDLY_NAME', 'MODULE_NAMESPACE'], - 'webpack' => ['LOWER_NAME'], - 'json' => ['LOWER_NAME', 'STUDLY_NAME', 'MODULE_NAMESPACE'], - 'views/index' => ['LOWER_NAME'], - 'views/master' => ['STUDLY_NAME','LOWER_NAME'], + 'start' => ['LOWER_NAME', 'ROUTES_LOCATION'], + 'routes' => ['LOWER_NAME', 'STUDLY_NAME', 'MODULE_NAMESPACE'], + 'webpack' => ['LOWER_NAME'], + 'json' => ['LOWER_NAME', 'STUDLY_NAME', 'MODULE_NAMESPACE'], + 'views/index' => ['LOWER_NAME'], + 'views/master' => ['STUDLY_NAME', 'LOWER_NAME'], 'scaffold/config' => ['STUDLY_NAME'], - 'composer' => [ + 'composer' => [ 'LOWER_NAME', 'STUDLY_NAME', 'VENDOR', @@ -97,29 +97,29 @@ | Set the generate key to false to not generate that folder */ 'generator' => [ - 'config' => ['path' => 'Config', 'generate' => true], - 'command' => ['path' => 'Console', 'generate' => true], - 'migration' => ['path' => 'Database/Migrations', 'generate' => true], - 'seeder' => ['path' => 'Database/Seeders', 'generate' => true], - 'factory' => ['path' => 'Database/factories', 'generate' => true], - 'model' => ['path' => 'Entities', 'generate' => true], - 'controller' => ['path' => 'Http/Controllers', 'generate' => true], - 'filter' => ['path' => 'Http/Middleware', 'generate' => true], - 'request' => ['path' => 'Http/Requests', 'generate' => true], - 'provider' => ['path' => 'Providers', 'generate' => true], - 'assets' => ['path' => 'Resources/assets', 'generate' => true], - 'lang' => ['path' => 'Resources/lang', 'generate' => true], - 'views' => ['path' => 'Resources/views', 'generate' => true], - 'test' => ['path' => 'Tests', 'generate' => true], - 'repository' => ['path' => 'Repositories', 'generate' => false], - 'event' => ['path' => 'Events', 'generate' => false], - 'listener' => ['path' => 'Listeners', 'generate' => false], - 'policies' => ['path' => 'Policies', 'generate' => false], - 'rules' => ['path' => 'Rules', 'generate' => false], - 'jobs' => ['path' => 'Jobs', 'generate' => false], - 'emails' => ['path' => 'Emails', 'generate' => false], + 'config' => ['path' => 'Config', 'generate' => true], + 'command' => ['path' => 'Console', 'generate' => true], + 'migration' => ['path' => 'Database/Migrations', 'generate' => true], + 'seeder' => ['path' => 'Database/Seeders', 'generate' => true], + 'factory' => ['path' => 'Database/factories', 'generate' => true], + 'model' => ['path' => 'Entities', 'generate' => true], + 'controller' => ['path' => 'Http/Controllers', 'generate' => true], + 'filter' => ['path' => 'Http/Middleware', 'generate' => true], + 'request' => ['path' => 'Http/Requests', 'generate' => true], + 'provider' => ['path' => 'Providers', 'generate' => true], + 'assets' => ['path' => 'Resources/assets', 'generate' => true], + 'lang' => ['path' => 'Resources/lang', 'generate' => true], + 'views' => ['path' => 'Resources/views', 'generate' => true], + 'test' => ['path' => 'Tests', 'generate' => true], + 'repository' => ['path' => 'Repositories', 'generate' => false], + 'event' => ['path' => 'Events', 'generate' => false], + 'listener' => ['path' => 'Listeners', 'generate' => false], + 'policies' => ['path' => 'Policies', 'generate' => false], + 'rules' => ['path' => 'Rules', 'generate' => false], + 'jobs' => ['path' => 'Jobs', 'generate' => false], + 'emails' => ['path' => 'Emails', 'generate' => false], 'notifications' => ['path' => 'Notifications', 'generate' => false], - 'resource' => ['path' => 'Transformers', 'generate' => false], + 'resource' => ['path' => 'Transformers', 'generate' => false], ], ], /* @@ -134,7 +134,7 @@ 'scan' => [ 'enabled' => false, - 'paths' => [ + 'paths' => [ base_path('vendor/*/*'), ], ], @@ -150,7 +150,7 @@ 'composer' => [ 'vendor' => 'nwidart', 'author' => [ - 'name' => 'Nicolas Widart', + 'name' => 'Nicolas Widart', 'email' => 'n.widart@gmail.com', ], ], @@ -163,8 +163,8 @@ | */ 'cache' => [ - 'enabled' => false, - 'key' => 'laravel-modules', + 'enabled' => false, + 'key' => 'laravel-modules', 'lifetime' => 60, ], /* @@ -176,7 +176,7 @@ */ 'register' => [ 'translations' => true, - /** + /* * load files on boot or register method * * Note: boot not compatible with asgardcms diff --git a/config/queue.php b/config/queue.php index 549322ed..581473df 100644 --- a/config/queue.php +++ b/config/queue.php @@ -35,32 +35,32 @@ ], 'database' => [ - 'driver' => 'database', - 'table' => 'jobs', - 'queue' => 'default', + 'driver' => 'database', + 'table' => 'jobs', + 'queue' => 'default', 'retry_after' => 90, ], 'beanstalkd' => [ - 'driver' => 'beanstalkd', - 'host' => 'localhost', - 'queue' => 'default', + 'driver' => 'beanstalkd', + 'host' => 'localhost', + 'queue' => 'default', 'retry_after' => 90, ], 'sqs' => [ 'driver' => 'sqs', - 'key' => 'your-public-key', + 'key' => 'your-public-key', 'secret' => 'your-secret-key', 'prefix' => 'https://sqs.us-east-1.amazonaws.com/your-account-id', - 'queue' => 'your-queue-name', + 'queue' => 'your-queue-name', 'region' => 'us-east-1', ], 'redis' => [ - 'driver' => 'redis', - 'connection' => 'default', - 'queue' => 'default', + 'driver' => 'redis', + 'connection' => 'default', + 'queue' => 'default', 'retry_after' => 90, ], @@ -79,7 +79,7 @@ 'failed' => [ 'database' => env('DB_CONNECTION', 'mysql'), - 'table' => 'failed_jobs', + 'table' => 'failed_jobs', ], ]; diff --git a/config/services.php b/config/services.php index 4460f0ec..6bb09524 100644 --- a/config/services.php +++ b/config/services.php @@ -20,7 +20,7 @@ ], 'ses' => [ - 'key' => env('SES_KEY'), + 'key' => env('SES_KEY'), 'secret' => env('SES_SECRET'), 'region' => 'us-east-1', ], @@ -30,8 +30,8 @@ ], 'stripe' => [ - 'model' => App\User::class, - 'key' => env('STRIPE_KEY'), + 'model' => App\User::class, + 'key' => env('STRIPE_KEY'), 'secret' => env('STRIPE_SECRET'), ], diff --git a/database/factories/ModelFactory.php b/database/factories/ModelFactory.php index 7926c794..8f5259ea 100644 --- a/database/factories/ModelFactory.php +++ b/database/factories/ModelFactory.php @@ -16,9 +16,9 @@ static $password; return [ - 'name' => $faker->name, - 'email' => $faker->unique()->safeEmail, - 'password' => $password ?: $password = bcrypt('secret'), + 'name' => $faker->name, + 'email' => $faker->unique()->safeEmail, + 'password' => $password ?: $password = bcrypt('secret'), 'remember_token' => str_random(10), ]; }); diff --git a/database/migrations/2015_03_02_031822_create_api_keys_table.php b/database/migrations/2015_03_02_031822_create_api_keys_table.php index 010c06bf..b858ebed 100644 --- a/database/migrations/2015_03_02_031822_create_api_keys_table.php +++ b/database/migrations/2015_03_02_031822_create_api_keys_table.php @@ -1,11 +1,10 @@ increments('id'); - $table->string('name'); - $table->string('city'); - $table->string('country'); - $table->string('iata'); - $table->string('icao'); - $table->double('lat'); - $table->double('lon'); - $table->longText('data')->nullable(); //JSON Data for All gate information for the system. + $table->increments('id'); + $table->string('name'); + $table->string('city'); + $table->string('country'); + $table->string('iata'); + $table->string('icao'); + $table->double('lat'); + $table->double('lon'); + $table->longText('data')->nullable(); //JSON Data for All gate information for the system. $table->softDeletes(); }); diff --git a/database/migrations/2016_10_08_062649_add_user_groups.php b/database/migrations/2016_10_08_062649_add_user_groups.php index d8f6d3c3..69b8e36e 100644 --- a/database/migrations/2016_10_08_062649_add_user_groups.php +++ b/database/migrations/2016_10_08_062649_add_user_groups.php @@ -13,8 +13,7 @@ class AddUserGroups extends Migration */ public function up() { - Schema::create('groups', function(Blueprint $table) - { + Schema::create('groups', function (Blueprint $table) { $table->increments('id'); $table->string('name'); $table->boolean('progress'); @@ -22,8 +21,7 @@ public function up() // ACCESS PERMISSIONS AND AIRCRAFT PIVOT TABLES $table->timestamps(); }); - Schema::create('group_user', function (Blueprint $table) - { + Schema::create('group_user', function (Blueprint $table) { $table->increments('id'); $table->integer('user_id')->unsigned()->nullable(); $table->foreign('user_id')->references('id')->on('users')->onDelete('set null'); @@ -41,7 +39,6 @@ public function up() */ public function down() { - Schema::drop('groups'); Schema::drop('user_group'); } diff --git a/database/migrations/2016_12_30_064544_add_user_columns.php b/database/migrations/2016_12_30_064544_add_user_columns.php index 45022ae5..f105a060 100644 --- a/database/migrations/2016_12_30_064544_add_user_columns.php +++ b/database/migrations/2016_12_30_064544_add_user_columns.php @@ -1,7 +1,6 @@ string('pid')->nullable(); $table->integer('hub_id')->nullable()->unsigned(); $table->foreign('hub_id')->references('id')->on('hubs')->onDelete('set null'); diff --git a/database/migrations/2017_08_14_195620_update_posion_report_table.php b/database/migrations/2017_08_14_195620_update_posion_report_table.php index 50be377a..50faa4ae 100644 --- a/database/migrations/2017_08_14_195620_update_posion_report_table.php +++ b/database/migrations/2017_08_14_195620_update_posion_report_table.php @@ -16,7 +16,6 @@ public function up() Schema::table('acarsdata', function (Blueprint $table) { $table->string('online', 10); $table->string('timeremaining', 6); - }); } diff --git a/database/migrations/2017_12_15_185150_major_update.php b/database/migrations/2017_12_15_185150_major_update.php index 399b862c..aca8990b 100644 --- a/database/migrations/2017_12_15_185150_major_update.php +++ b/database/migrations/2017_12_15_185150_major_update.php @@ -13,8 +13,7 @@ class MajorUpdate extends Migration */ public function up() { - - Schema::table('airlines', function(Blueprint $table) { + Schema::table('airlines', function (Blueprint $table) { $table->boolean('autoAccept')->nullable(); $table->boolean('isAccepting')->nullable(); $table->boolean('autoAdd')->nullable(); @@ -29,7 +28,7 @@ public function up() $table->unsignedInteger('user_id')->nullable(); }); - Schema::create('airline_user', function(Blueprint $table) { + Schema::create('airline_user', function (Blueprint $table) { $table->increments('id'); $table->unsignedInteger('user_id'); $table->unsignedInteger('airline_id'); @@ -42,11 +41,11 @@ public function up() $table->boolean('admin'); }); - Schema::table('aircraft_groups', function(Blueprint $table) { + Schema::table('aircraft_groups', function (Blueprint $table) { $table->unsignedInteger('airline_id')->nullable(); $table->foreign('airline_id')->references('id')->on('airlines')->onDelete('cascade'); }); - Schema::table('flights', function(Blueprint $table) { + Schema::table('flights', function (Blueprint $table) { $table->string('wcBidID')->nullable(); $table->integer('status')->nullable(); $table->string('network')->nullable(); @@ -60,7 +59,7 @@ public function up() $table->integer('type')->nullable(); $table->integer('state'); }); - Schema::create('system_settings', function(Blueprint $table) { + Schema::create('system_settings', function (Blueprint $table) { $table->increments('id'); $table->string('key'); $table->string('value'); @@ -69,14 +68,14 @@ public function up() $table->string('page'); $table->text('description')->nullable(); }); - Schema::create('aircraft_schedule', function (Blueprint $t){ + Schema::create('aircraft_schedule', function (Blueprint $t) { $t->increments('id'); $t->unsignedInteger('aircraft_id'); $t->unsignedInteger('schedule_id'); $t->foreign('aircraft_id')->references('id')->on('aircraft')->onDelete('cascade'); $t->foreign('schedule_id')->references('id')->on('schedules')->onDelete('cascade'); }); - Schema::create('aircraft_group_schedule', function (Blueprint $t){ + Schema::create('aircraft_group_schedule', function (Blueprint $t) { $t->increments('id'); $t->unsignedInteger('aircraft_group_id'); $t->unsignedInteger('schedule_id'); diff --git a/database/migrations/2018_01_02_010104_create_permission_system.php b/database/migrations/2018_01_02_010104_create_permission_system.php index 87c0a229..f20f81d7 100644 --- a/database/migrations/2018_01_02_010104_create_permission_system.php +++ b/database/migrations/2018_01_02_010104_create_permission_system.php @@ -23,7 +23,6 @@ public function up() $t->unsignedInteger('airline_id')->nullable(); $t->foreign('airline_id')->references('id')->on('airlines')->onDelete('cascade'); $t->text('description')->nullable(); - }); Schema::create('permission_groups', function (Blueprint $t) { $t->increments('id'); @@ -33,7 +32,7 @@ public function up() $t->text('description')->nullable(); }); - /** + /* * Pivot Tables */ Schema::create('permission_permission_group', function (Blueprint $t) { diff --git a/database/migrations/2018_01_02_025251_create_event_system.php b/database/migrations/2018_01_02_025251_create_event_system.php index 483d76d3..3f1e2c44 100644 --- a/database/migrations/2018_01_02_025251_create_event_system.php +++ b/database/migrations/2018_01_02_025251_create_event_system.php @@ -52,7 +52,7 @@ public function up() $table->foreign('depapt_id')->references('id')->on('airports')->onDelete('cascade'); $table->foreign('arrapt_id')->references('id')->on('airports')->onDelete('cascade'); }); - /** + /* * Pivot Tables Below */ Schema::create('airline_event_user', function (Blueprint $table) { diff --git a/database/migrations/2018_01_02_083826_create_news_system.php b/database/migrations/2018_01_02_083826_create_news_system.php index dd5da268..a6942b76 100644 --- a/database/migrations/2018_01_02_083826_create_news_system.php +++ b/database/migrations/2018_01_02_083826_create_news_system.php @@ -13,7 +13,7 @@ class CreateNewsSystem extends Migration */ public function up() { - Schema::create('news', function (Blueprint $t){ + Schema::create('news', function (Blueprint $t) { $t->increments('id'); $t->string('title'); $t->string('url_slug'); diff --git a/database/seeds/TestDataSeeder.php b/database/seeds/TestDataSeeder.php index fe388d6f..4b9980a9 100644 --- a/database/seeds/TestDataSeeder.php +++ b/database/seeds/TestDataSeeder.php @@ -11,6 +11,5 @@ class TestDataSeeder extends Seeder */ public function run() { - } } diff --git a/resources/lang/ar/messages.php b/resources/lang/ar/messages.php index d071a6fc..711ca457 100644 --- a/resources/lang/ar/messages.php +++ b/resources/lang/ar/messages.php @@ -2,16 +2,15 @@ return [ - /** + /* * * Shared translations. * */ 'title' => 'تنصيب Laravel', - 'next' => 'متابعة', + 'next' => 'متابعة', - - /** + /* * * Home page translations. * @@ -21,8 +20,7 @@ 'message' => 'أهلا بك في صفحة تنصيب Laravel', ], - - /** + /* * * Requirements page translations. * @@ -31,8 +29,7 @@ 'title' => 'المتطلبات', ], - - /** + /* * * Permissions page translations. * @@ -41,28 +38,26 @@ 'title' => 'تراخيص المجلدات', ], - - /** + /* * * Environment page translations. * */ 'environment' => [ - 'title' => 'الإعدادات', - 'save' => 'حفظ ملف .env', + 'title' => 'الإعدادات', + 'save' => 'حفظ ملف .env', 'success' => 'تم حفظ الإعدادات بنجاح', - 'errors' => 'حدث خطأ أثناء إنشاء ملف .env. رجاءا قم بإنشاءه يدويا', + 'errors' => 'حدث خطأ أثناء إنشاء ملف .env. رجاءا قم بإنشاءه يدويا', ], - - /** + /* * * Final page translations. * */ 'final' => [ - 'title' => 'النهاية', + 'title' => 'النهاية', 'finished' => 'تم تنصيب البرنامج بنجاح...', - 'exit' => 'إضغط هنا للخروج', + 'exit' => 'إضغط هنا للخروج', ], ]; diff --git a/resources/lang/de/messages.php b/resources/lang/de/messages.php index 15d86842..b7d7e71c 100644 --- a/resources/lang/de/messages.php +++ b/resources/lang/de/messages.php @@ -2,17 +2,16 @@ return [ - /** + /* * * Shared translations. * */ - 'title' => 'Laravel Installer', - 'next' => 'Nächster Schritt', + 'title' => 'Laravel Installer', + 'next' => 'Nächster Schritt', 'finish' => 'Installieren', - - /** + /* * * Home page translations. * @@ -22,8 +21,7 @@ 'message' => 'Willkommen zum Laravel Installationsassistent.', ], - - /** + /* * * Requirements page translations. * @@ -32,8 +30,7 @@ 'title' => 'Vorraussetzungen', ], - - /** + /* * * Permissions page translations. * @@ -42,28 +39,26 @@ 'title' => 'Berechtigungen', ], - - /** + /* * * Environment page translations. * */ 'environment' => [ - 'title' => 'Umgebungsvariablen', - 'save' => 'Speicher .env', + 'title' => 'Umgebungsvariablen', + 'save' => 'Speicher .env', 'success' => 'Ihre .env Konfiguration wurde gespeichert.', - 'errors' => 'Ihre .env Konfiguration konnte nicht gespeichert werden, Bitte erstellen Sie diese Manuell.', + 'errors' => 'Ihre .env Konfiguration konnte nicht gespeichert werden, Bitte erstellen Sie diese Manuell.', ], - - /** + /* * * Final page translations. * */ 'final' => [ - 'title' => 'Fertig!', + 'title' => 'Fertig!', 'finished' => 'Die Anwendung wurde erfolgreich Installiert.', - 'exit' => 'Hier Klicken zum Beenden', + 'exit' => 'Hier Klicken zum Beenden', ], ]; diff --git a/resources/lang/en/auth.php b/resources/lang/en/auth.php index e5506df2..6ef1a733 100644 --- a/resources/lang/en/auth.php +++ b/resources/lang/en/auth.php @@ -13,7 +13,7 @@ | */ - 'failed' => 'These credentials do not match our records.', + 'failed' => 'These credentials do not match our records.', 'throttle' => 'Too many login attempts. Please try again in :seconds seconds.', ]; diff --git a/resources/lang/en/messages.php b/resources/lang/en/messages.php index 687bb818..f0042683 100644 --- a/resources/lang/en/messages.php +++ b/resources/lang/en/messages.php @@ -2,17 +2,16 @@ return [ - /** + /* * * Shared translations. * */ - 'title' => 'VAOS Installer', - 'next' => 'Next Step', + 'title' => 'VAOS Installer', + 'next' => 'Next Step', 'finish' => 'Install', - - /** + /* * * Home page translations. * @@ -22,8 +21,7 @@ 'message' => 'This installer will walk you through the initial setup', ], - - /** + /* * * Requirements page translations. * @@ -32,8 +30,7 @@ 'title' => 'Requirements', ], - - /** + /* * * Permissions page translations. * @@ -42,30 +39,28 @@ 'title' => 'Permissions', ], - - /** + /* * * Environment page translations. * */ 'environment' => [ - 'title' => 'Environment Settings', - 'save' => 'Save .env', + 'title' => 'Environment Settings', + 'save' => 'Save .env', 'success' => 'Your .env file settings have been saved.', - 'errors' => 'Unable to save the .env file, Please create it manually.', + 'errors' => 'Unable to save the .env file, Please create it manually.', ], - - 'install' => 'Install', + 'install' => 'Install', - /** + /* * * Final page translations. * */ 'final' => [ - 'title' => 'Finished', + 'title' => 'Finished', 'finished' => 'VAOS has been installed, however there are additional steps to setup your airline. You will find those on the admin panel.', - 'exit' => 'Proceed to Admin Panel', + 'exit' => 'Proceed to Admin Panel', ], ]; diff --git a/resources/lang/en/passwords.php b/resources/lang/en/passwords.php index e5544d20..ffa19ba4 100644 --- a/resources/lang/en/passwords.php +++ b/resources/lang/en/passwords.php @@ -14,9 +14,9 @@ */ 'password' => 'Passwords must be at least six characters and match the confirmation.', - 'reset' => 'Your password has been reset!', - 'sent' => 'We have e-mailed your password reset link!', - 'token' => 'This password reset token is invalid.', - 'user' => "We can't find a user with that e-mail address.", + 'reset' => 'Your password has been reset!', + 'sent' => 'We have e-mailed your password reset link!', + 'token' => 'This password reset token is invalid.', + 'user' => "We can't find a user with that e-mail address.", ]; diff --git a/resources/lang/es/messages.php b/resources/lang/es/messages.php index d96ce0ce..8bd08e11 100644 --- a/resources/lang/es/messages.php +++ b/resources/lang/es/messages.php @@ -2,17 +2,16 @@ return [ - /** + /* * * Traducciones compartidas. * */ - 'title' => 'Instalador de Laravel', - 'next' => 'Siguiente', + 'title' => 'Instalador de Laravel', + 'next' => 'Siguiente', 'finish' => 'Instalar', - - /** + /* * * Traducciones de la página principal. * @@ -22,8 +21,7 @@ 'message' => 'Bienvenido al asistente de configuración', ], - - /** + /* * * Tranducciones de la página de requisitos. * @@ -32,8 +30,7 @@ 'title' => 'Requisitos', ], - - /** + /* * * Traducciones de la pagina de permisos. * @@ -42,28 +39,26 @@ 'title' => 'Permisos', ], - - /** + /* * * Traducciones de la página de entorno. * */ 'environment' => [ - 'title' => 'Configuraciones del entorno', - 'save' => 'Guardar archivo .env', + 'title' => 'Configuraciones del entorno', + 'save' => 'Guardar archivo .env', 'success' => 'Los cambios en tu archivo .env han sido guardados.', - 'errors' => 'No es posible crear el archivo .env, por favor intentalo manualmente.', + 'errors' => 'No es posible crear el archivo .env, por favor intentalo manualmente.', ], - - /** + /* * * Traducciones de la página final. * */ 'final' => [ - 'title' => 'Finalizado.', + 'title' => 'Finalizado.', 'finished' => 'La aplicación ha sido instalada con éxito!', - 'exit' => 'Haz click aquí para salir.', + 'exit' => 'Haz click aquí para salir.', ], ]; diff --git a/resources/lang/et/messages.php b/resources/lang/et/messages.php index 6ff7088c..5efa1537 100644 --- a/resources/lang/et/messages.php +++ b/resources/lang/et/messages.php @@ -2,16 +2,15 @@ return [ - /** + /* * * Shared translations. * */ 'title' => 'Laraveli installer', - 'next' => 'Järgmine samm', + 'next' => 'Järgmine samm', - - /** + /* * * Home page translations. * @@ -21,8 +20,7 @@ 'message' => 'Tere tulemast installatsiooniviisardisse.', ], - - /** + /* * * Requirements page translations. * @@ -31,8 +29,7 @@ 'title' => 'Nõuded', ], - - /** + /* * * Permissions page translations. * @@ -41,28 +38,26 @@ 'title' => 'Õigused', ], - - /** + /* * * Environment page translations. * */ 'environment' => [ - 'title' => 'Keskkonna seaded', - 'save' => 'Salvesta .env', + 'title' => 'Keskkonna seaded', + 'save' => 'Salvesta .env', 'success' => 'Sinu .env faili seaded on salvestatud.', - 'errors' => 'Ei saanud .env faili salvesta, palun loo see manuaalselt.', + 'errors' => 'Ei saanud .env faili salvesta, palun loo see manuaalselt.', ], - - /** + /* * * Final page translations. * */ 'final' => [ - 'title' => 'Lõpetatud', + 'title' => 'Lõpetatud', 'finished' => 'Laravel on edukalt installitud', - 'exit' => 'Väljumiseks vajuta siia', + 'exit' => 'Väljumiseks vajuta siia', ], ]; diff --git a/resources/lang/fa/messages.php b/resources/lang/fa/messages.php index 26939db8..00897231 100644 --- a/resources/lang/fa/messages.php +++ b/resources/lang/fa/messages.php @@ -2,16 +2,15 @@ return [ - /** + /* * * Shared translations. * */ 'title' => 'نصب کننده لاراول', - 'next' => 'قدم بعدی', + 'next' => 'قدم بعدی', - - /** + /* * * Home page translations. * @@ -21,8 +20,7 @@ 'message' => 'به جادوگر نصب خوش آمدید .', ], - - /** + /* * * Requirements page translations. * @@ -31,8 +29,7 @@ 'title' => 'نیازمندی ها', ], - - /** + /* * * Permissions page translations. * @@ -41,28 +38,26 @@ 'title' => 'مجوز های دسترسی', ], - - /** + /* * * Environment page translations. * */ 'environment' => [ - 'title' => 'تنظیمات پیکربندی', - 'save' => 'ذخیره کردن .env', + 'title' => 'تنظیمات پیکربندی', + 'save' => 'ذخیره کردن .env', 'success' => 'فایل .env برای شما ذخیره شد.', - 'errors' => 'ذخیره کردن فایل .env امکان پذیر نیست، لطفا آن را به صورت دستی ایجاد کنید.', + 'errors' => 'ذخیره کردن فایل .env امکان پذیر نیست، لطفا آن را به صورت دستی ایجاد کنید.', ], - - /** + /* * * Final page translations. * */ 'final' => [ - 'title' => 'تمام شد', + 'title' => 'تمام شد', 'finished' => 'اپلیکیشن با موفقیت نصب شد.', - 'exit' => 'برای خروج اینجا را کلیک کنید', + 'exit' => 'برای خروج اینجا را کلیک کنید', ], ]; diff --git a/resources/lang/fr/messages.php b/resources/lang/fr/messages.php index 2c23a72b..0155425b 100644 --- a/resources/lang/fr/messages.php +++ b/resources/lang/fr/messages.php @@ -2,16 +2,15 @@ return [ - /** + /* * * Shared translations. * */ 'title' => 'Installateur de Laravel', - 'next' => 'Suivant', + 'next' => 'Suivant', - - /** + /* * * Home page translations. * @@ -21,8 +20,7 @@ 'message' => 'Bienvenue dans le programme d’installation.', ], - - /** + /* * * Requirements page translations. * @@ -31,8 +29,7 @@ 'title' => 'Prérequis', ], - - /** + /* * * Permissions page translations. * @@ -41,28 +38,26 @@ 'title' => 'Permissions', ], - - /** + /* * * Environment page translations. * */ 'environment' => [ - 'title' => 'Paramètres d’environment', - 'save' => 'Enregistrer .env', + 'title' => 'Paramètres d’environment', + 'save' => 'Enregistrer .env', 'success' => 'Votre fichier .env a été sauvegardé.', - 'errors' => 'Impossible d’enregistrer le fichier .env, il faut que vous le créiez manuellement.', + 'errors' => 'Impossible d’enregistrer le fichier .env, il faut que vous le créiez manuellement.', ], - - /** + /* * * Final page translations. * */ 'final' => [ - 'title' => 'Terminé', + 'title' => 'Terminé', 'finished' => 'L’application a été installée avec succès.', - 'exit' => 'Cliquez ici pour quitter', + 'exit' => 'Cliquez ici pour quitter', ], ]; diff --git a/resources/lang/gr/messages.php b/resources/lang/gr/messages.php index ed8a771d..0b236c72 100644 --- a/resources/lang/gr/messages.php +++ b/resources/lang/gr/messages.php @@ -2,16 +2,15 @@ return [ - /** + /* * * Shared translations. * */ 'title' => 'Εγκατάσταση Laravel', - 'next' => 'Επόμενο', + 'next' => 'Επόμενο', - - /** + /* * * Home page translations. * @@ -21,8 +20,7 @@ 'message' => 'Καλωσήρθατε στον οδηγό εγκατάστασης.', ], - - /** + /* * * Requirements page translations. * @@ -31,8 +29,7 @@ 'title' => 'Απαιτήσεις συστήματος', ], - - /** + /* * * Permissions page translations. * @@ -41,28 +38,26 @@ 'title' => 'Δικαιώματα', ], - - /** + /* * * Environment page translations. * */ 'environment' => [ - 'title' => 'Ρυθμίσεις Περιβάλλοντος', - 'save' => 'Αποθήκευση .env αρχείου', + 'title' => 'Ρυθμίσεις Περιβάλλοντος', + 'save' => 'Αποθήκευση .env αρχείου', 'success' => 'Το αρχείο ρυθμίσεων .env έχει αποθηκευτεί με επιτυχία.', - 'errors' => 'Το αρχείο ρυθμίσεων .env ΔΕΝ μπόρεσε να αποθηκευτεί με επιτυχία. Παρακαλώ δημιουργίστε το χειροκίνητα.', + 'errors' => 'Το αρχείο ρυθμίσεων .env ΔΕΝ μπόρεσε να αποθηκευτεί με επιτυχία. Παρακαλώ δημιουργίστε το χειροκίνητα.', ], - - /** + /* * * Final page translations. * */ 'final' => [ - 'title' => 'Ολοκληρώθηκε', + 'title' => 'Ολοκληρώθηκε', 'finished' => 'Το πρόγραμμά σας εγκαταστάθηκε με επιτυχία.', - 'exit' => 'Πατήστε εδώ για έξοδο.', + 'exit' => 'Πατήστε εδώ για έξοδο.', ], ]; diff --git a/resources/lang/it/messages.php b/resources/lang/it/messages.php index e22a7947..6afaa7ac 100644 --- a/resources/lang/it/messages.php +++ b/resources/lang/it/messages.php @@ -1,14 +1,15 @@ 'Laravel Installer', - 'next' => 'Passo successivo', + 'title' => 'Laravel Installer', + 'next' => 'Passo successivo', 'finish' => 'Installa', - /** + /* * * Home page translations. * @@ -17,7 +18,7 @@ 'title' => 'Benvenuto al programma di installazione', 'message' => 'Benvenuto alla configurazione guidata.', ], - /** + /* * * Requirements page translations. * @@ -25,7 +26,7 @@ 'requirements' => [ 'title' => 'Requisiti', ], - /** + /* * * Permissions page translations. * @@ -33,25 +34,25 @@ 'permissions' => [ 'title' => 'Permessi', ], - /** + /* * * Environment page translations. * */ 'environment' => [ - 'title' => 'Configurazione ambiente', - 'save' => 'Salva .env', + 'title' => 'Configurazione ambiente', + 'save' => 'Salva .env', 'success' => 'La configurazione del file .env è stata salvata correttamente.', - 'errors' => 'Impossibile salvare il file .env, per favore crealo manualmente.', + 'errors' => 'Impossibile salvare il file .env, per favore crealo manualmente.', ], - /** + /* * * Final page translations. * */ 'final' => [ - 'title' => 'Finito', + 'title' => 'Finito', 'finished' => 'L\'applicazione è stata configurata correttamente.', - 'exit' => 'Clicca qui per uscire', + 'exit' => 'Clicca qui per uscire', ], ]; diff --git a/resources/lang/nl/messages.php b/resources/lang/nl/messages.php index 892c2920..eaecbdff 100644 --- a/resources/lang/nl/messages.php +++ b/resources/lang/nl/messages.php @@ -2,16 +2,15 @@ return [ - /** + /* * * Shared translations. * */ 'title' => 'Laravel Installer', - 'next' => 'Volgende stap', + 'next' => 'Volgende stap', - - /** + /* * * Home page translations. * @@ -21,8 +20,7 @@ 'message' => 'Welkom bij de installatiewizard', ], - - /** + /* * * Requirements page translations. * @@ -31,8 +29,7 @@ 'title' => 'Vereisten', ], - - /** + /* * * Permissions page translations. * @@ -41,28 +38,26 @@ 'title' => 'Permissies', ], - - /** + /* * * Environment page translations. * */ 'environment' => [ - 'title' => 'Environment Settings', - 'save' => '.env Opslaan', + 'title' => 'Environment Settings', + 'save' => '.env Opslaan', 'success' => 'Uw .env bestand is opgeslagen.', - 'errors' => 'Het is niet mogelijk om een .env bestand aan te maken, maak a.u.b het bestand zelf aan.', + 'errors' => 'Het is niet mogelijk om een .env bestand aan te maken, maak a.u.b het bestand zelf aan.', ], - - /** + /* * * Final page translations. * */ 'final' => [ - 'title' => 'Voltooid', + 'title' => 'Voltooid', 'finished' => 'Applicatie is succesvol geïnstalleerd.', - 'exit' => 'Klik hier om af te sluiten.', + 'exit' => 'Klik hier om af te sluiten.', ], ]; diff --git a/resources/lang/pl/messages.php b/resources/lang/pl/messages.php index a57f12a2..b60c81ae 100644 --- a/resources/lang/pl/messages.php +++ b/resources/lang/pl/messages.php @@ -2,16 +2,15 @@ return [ - /** + /* * * Shared translations. * */ 'title' => 'Laravel Instalator', - 'next' => 'Następny krok', + 'next' => 'Następny krok', - - /** + /* * * Home page translations. * @@ -21,8 +20,7 @@ 'message' => 'Witaj w kreatorze instalacji.', ], - - /** + /* * * Requirements page translations. * @@ -31,8 +29,7 @@ 'title' => 'Wymagania systemowe ', ], - - /** + /* * * Permissions page translations. * @@ -41,28 +38,26 @@ 'title' => 'Uprawnienia', ], - - /** + /* * * Environment page translations. * */ 'environment' => [ - 'title' => 'Ustawnienia środowiska', - 'save' => 'Zapisz .env', + 'title' => 'Ustawnienia środowiska', + 'save' => 'Zapisz .env', 'success' => 'Plik .env został poprawnie zainstalowany.', - 'errors' => 'Nie można zapisać pliku .env, Proszę utworzyć go ręcznie.', + 'errors' => 'Nie można zapisać pliku .env, Proszę utworzyć go ręcznie.', ], - - /** + /* * * Final page translations. * */ 'final' => [ - 'title' => 'Instalacja zakończona', + 'title' => 'Instalacja zakończona', 'finished' => 'Aplikacja została poprawnie zainstalowana.', - 'exit' => 'Kliknij aby zakończyć', + 'exit' => 'Kliknij aby zakończyć', ], ]; diff --git a/resources/lang/pt-br/messages.php b/resources/lang/pt-br/messages.php index 685a49fb..b5bd3863 100644 --- a/resources/lang/pt-br/messages.php +++ b/resources/lang/pt-br/messages.php @@ -2,17 +2,16 @@ return [ - /** + /* * * Shared translations. * */ - 'title' => 'Instalador Laravel', - 'next' => 'Próximo Passo', + 'title' => 'Instalador Laravel', + 'next' => 'Próximo Passo', 'finish' => 'Instalar', - - /** + /* * * Home page translations. * @@ -22,8 +21,7 @@ 'message' => 'Bem-vindo ao assistente de configuração.', ], - - /** + /* * * Requirements page translations. * @@ -32,8 +30,7 @@ 'title' => 'Requisitos', ], - - /** + /* * * Permissions page translations. * @@ -42,28 +39,26 @@ 'title' => 'Permissões', ], - - /** + /* * * Environment page translations. * */ 'environment' => [ - 'title' => 'Configurações de Ambiente', - 'save' => 'Salvar .env', + 'title' => 'Configurações de Ambiente', + 'save' => 'Salvar .env', 'success' => 'Suas configurações de arquivo .env foram salvas.', - 'errors' => 'Não foi possível salvar o arquivo .env, por favor crie-o manualmente.', + 'errors' => 'Não foi possível salvar o arquivo .env, por favor crie-o manualmente.', ], - - /** + /* * * Final page translations. * */ 'final' => [ - 'title' => 'Terminado', + 'title' => 'Terminado', 'finished' => 'Aplicação foi instalada com sucesso', - 'exit' => 'Clique aqui para sair', + 'exit' => 'Clique aqui para sair', ], ]; diff --git a/resources/lang/pt/messages.php b/resources/lang/pt/messages.php index 6603fe2c..430af8a7 100644 --- a/resources/lang/pt/messages.php +++ b/resources/lang/pt/messages.php @@ -2,17 +2,16 @@ return [ - /** + /* * * Shared translations. * */ - 'title' => 'Instalador Laravel', - 'next' => 'Próximo Passo', + 'title' => 'Instalador Laravel', + 'next' => 'Próximo Passo', 'finish' => 'Instalar', - - /** + /* * * Home page translations. * @@ -22,8 +21,7 @@ 'message' => 'Bem-vindo ao assistente de configuração.', ], - - /** + /* * * Requirements page translations. * @@ -32,8 +30,7 @@ 'title' => 'Requisitos', ], - - /** + /* * * Permissions page translations. * @@ -42,28 +39,26 @@ 'title' => 'Permissões', ], - - /** + /* * * Environment page translations. * */ 'environment' => [ - 'title' => 'Configurações de Ambiente', - 'save' => 'Salvar .env', + 'title' => 'Configurações de Ambiente', + 'save' => 'Salvar .env', 'success' => 'Suas configurações de arquivo .env foram gravadas.', - 'errors' => 'Não foi possível gravar o arquivo .env, por favor crie-o manualmente.', + 'errors' => 'Não foi possível gravar o arquivo .env, por favor crie-o manualmente.', ], - - /** + /* * * Final page translations. * */ 'final' => [ - 'title' => 'Terminado', + 'title' => 'Terminado', 'finished' => 'Aplicação foi instalada com sucesso', - 'exit' => 'Clique aqui para sair', + 'exit' => 'Clique aqui para sair', ], ]; diff --git a/resources/lang/ro/messages.php b/resources/lang/ro/messages.php index 6231075a..1d454635 100644 --- a/resources/lang/ro/messages.php +++ b/resources/lang/ro/messages.php @@ -2,16 +2,15 @@ return [ - /** + /* * * Shared translations. * */ 'title' => 'Procesul de instalare Laravel', - 'next' => 'Pasul următor', + 'next' => 'Pasul următor', - - /** + /* * * Home page translations. * @@ -21,8 +20,7 @@ 'message' => 'Bun venit în configurarea asistată.', ], - - /** + /* * * Requirements page translations. * @@ -31,8 +29,7 @@ 'title' => 'Cerințe', ], - - /** + /* * * Permissions page translations. * @@ -41,28 +38,26 @@ 'title' => 'Permisiuni', ], - - /** + /* * * Environment page translations. * */ 'environment' => [ - 'title' => 'Settări ale mediului', - 'save' => 'Salvează fișier .env', + 'title' => 'Settări ale mediului', + 'save' => 'Salvează fișier .env', 'success' => 'Setările tale au fost salvate în fișierul .env.', - 'errors' => 'Nu am putut salva fișierul .env, Te rugăm să-l creezi manual.', + 'errors' => 'Nu am putut salva fișierul .env, Te rugăm să-l creezi manual.', ], - - /** + /* * * Final page translations. * */ 'final' => [ - 'title' => 'Am terminat', + 'title' => 'Am terminat', 'finished' => 'Aplicația a fost instalată cu succes.', - 'exit' => 'Click aici pentru a ieși', + 'exit' => 'Click aici pentru a ieși', ], ]; diff --git a/resources/lang/ru/messages.php b/resources/lang/ru/messages.php index e4542868..a53565a9 100644 --- a/resources/lang/ru/messages.php +++ b/resources/lang/ru/messages.php @@ -2,7 +2,7 @@ return [ - /** + /* * * Shared translations. * @@ -10,8 +10,7 @@ 'title' => 'Установка Laravel', 'next' => 'Следующий шаг', - - /** + /* * * Home page translations. * @@ -21,8 +20,7 @@ 'message' => 'Добро пожаловать в первоначальную настройку фреймворка Laravel.', ], - - /** + /* * * Requirements page translations. * @@ -31,8 +29,7 @@ 'title' => 'Необходимые модули', ], - - /** + /* * * Permissions page translations. * @@ -41,8 +38,7 @@ 'title' => 'Проверка прав на папках', ], - - /** + /* * * Environment page translations. * @@ -54,8 +50,7 @@ 'errors' => 'Произошла ошибка при сохранении файла .env, пожалуйста, сохраните его вручную', ], - - /** + /* * * Final page translations. * diff --git a/resources/lang/tr/messages.php b/resources/lang/tr/messages.php index c95f3626..4471a8c5 100644 --- a/resources/lang/tr/messages.php +++ b/resources/lang/tr/messages.php @@ -2,15 +2,15 @@ return [ - /** + /* * * Shared translations. * */ 'title' => 'Laravel Installer', - 'next' => 'Sonraki Adım', - - /** + 'next' => 'Sonraki Adım', + + /* * * Home page translations. * @@ -19,8 +19,8 @@ 'title' => 'Installer\'a Hoşgeldiniz', 'message' => 'Kurulum sihirbazına hoşgeldiniz.', ], - - /** + + /* * * Requirements page translations. * @@ -28,8 +28,8 @@ 'requirements' => [ 'title' => 'Gereksinimler', ], - - /** + + /* * * Permissions page translations. * @@ -37,27 +37,27 @@ 'permissions' => [ 'title' => 'İzinler', ], - - /** + + /* * * Environment page translations. * */ 'environment' => [ - 'title' => 'Ortam Ayarları', - 'save' => '.env\'yi Kaydet', + 'title' => 'Ortam Ayarları', + 'save' => '.env\'yi Kaydet', 'success' => '.env dosyanız kaydedildi.', - 'errors' => '.env dosyanız kaydedilemedi, lütfen manuel yaratınız.', + 'errors' => '.env dosyanız kaydedilemedi, lütfen manuel yaratınız.', ], - - /** + + /* * * Final page translations. * */ 'final' => [ - 'title' => 'Tamamlandı', + 'title' => 'Tamamlandı', 'finished' => 'Uygulama başarıyla yüklendi.', - 'exit' => 'Çıkış yapmak için tıklayınız', + 'exit' => 'Çıkış yapmak için tıklayınız', ], ]; diff --git a/resources/lang/zh-CN/messages.php b/resources/lang/zh-CN/messages.php index 32bf75dc..c24706e9 100644 --- a/resources/lang/zh-CN/messages.php +++ b/resources/lang/zh-CN/messages.php @@ -2,17 +2,16 @@ return [ - /** + /* * * Shared translations. * */ - 'title' => 'Laravel安装程序', - 'next' => '下一步', + 'title' => 'Laravel安装程序', + 'next' => '下一步', 'finish' => '安装', - - /** + /* * * Home page translations. * @@ -22,8 +21,7 @@ 'message' => '欢迎来到安装向导.', ], - - /** + /* * * Requirements page translations. * @@ -32,8 +30,7 @@ 'title' => '环境要求', ], - - /** + /* * * Permissions page translations. * @@ -42,28 +39,26 @@ 'title' => '权限', ], - - /** + /* * * Environment page translations. * */ 'environment' => [ - 'title' => '环境设置', - 'save' => '保存 .env', + 'title' => '环境设置', + 'save' => '保存 .env', 'success' => '.env 文件保存成功.', - 'errors' => '无法保存 .env 文件, 请手动创建它.', + 'errors' => '无法保存 .env 文件, 请手动创建它.', ], - - /** + /* * * Final page translations. * */ 'final' => [ - 'title' => '完成', + 'title' => '完成', 'finished' => '应用已成功安装.', - 'exit' => '点击退出', + 'exit' => '点击退出', ], ]; diff --git a/resources/lang/zh-TW/messages.php b/resources/lang/zh-TW/messages.php index fbf14392..a06391aa 100644 --- a/resources/lang/zh-TW/messages.php +++ b/resources/lang/zh-TW/messages.php @@ -2,17 +2,16 @@ return [ - /** + /* * * Shared translations. * */ - 'title' => 'Laravel安裝程序', - 'next' => '下一步', + 'title' => 'Laravel安裝程序', + 'next' => '下一步', 'finish' => '安裝', - - /** + /* * * Home page translations. * @@ -22,8 +21,7 @@ 'message' => '歡迎來到安裝嚮導.', ], - - /** + /* * * Requirements page translations. * @@ -32,8 +30,7 @@ 'title' => '環境要求', ], - - /** + /* * * Permissions page translations. * @@ -42,28 +39,26 @@ 'title' => '權限', ], - - /** + /* * * Environment page translations. * */ 'environment' => [ - 'title' => '環境設置', - 'save' => '保存 .env', + 'title' => '環境設置', + 'save' => '保存 .env', 'success' => '.env 文件保存成功.', - 'errors' => '無法保存 .env 文件, 請手動創建它.', + 'errors' => '無法保存 .env 文件, 請手動創建它.', ], - - /** + /* * * Final page translations. * */ 'final' => [ - 'title' => '完成', + 'title' => '完成', 'finished' => '應用已成功安裝.', - 'exit' => '點擊退出', + 'exit' => '點擊退出', ], ]; diff --git a/routes/api.php b/routes/api.php index e747ff40..ab150d5f 100644 --- a/routes/api.php +++ b/routes/api.php @@ -1,6 +1,5 @@ isDot() && !$file->isDir() && $file->getFilename() != '.gitignore') - { - require_once $basepath.'/routes/api/'.$file->getFilename(); - } -} \ No newline at end of file +foreach (new DirectoryIterator($basepath.'/routes/api') as $file) { + if (! $file->isDot() && ! $file->isDir() && $file->getFilename() != '.gitignore') { + require_once $basepath.'/routes/api/'.$file->getFilename(); + } +} diff --git a/routes/api/api.php b/routes/api/api.php index 684ba206..3121fe8d 100644 --- a/routes/api/api.php +++ b/routes/api/api.php @@ -18,20 +18,17 @@ })->middleware('auth:api'); Route::group(['prefix' => 'v1', 'namespace' => 'API'], function () { Route::post('/auth', 'AuthAPI@acarsLogin'); - Route::group(['prefix' => '/acars'], function () - { + Route::group(['prefix' => '/acars'], function () { Route::post('/posrpt', 'AcarsAPI@position'); Route::get('/wx', 'AcarsAPI@getwx'); Route::get('/data', 'AcarsAPI@getAcarsData'); }); // Airports Database Functions - Route::group(['prefix' => '/airports'], function () - { + Route::group(['prefix' => '/airports'], function () { Route::post('/', 'AirportsAPI@add'); }); // Schedule System - Route::group(['prefix' => '/schedule'], function () - { + Route::group(['prefix' => '/schedule'], function () { Route::get('/', 'ScheduleAPI@index'); Route::get('/bid', 'BidsAPI@getBid'); Route::post('/bid', 'BidsAPI@fileBid'); @@ -55,7 +52,7 @@ | */ -if (!env('VAOS_Setup')) { +if (! env('VAOS_Setup')) { Route::post('/import/phpvms/user', 'Admin\InstallController@importphpVMSUser'); } Route::group(['prefix' => 'acars', 'namespace' => 'LegacyACARS'], function () { @@ -69,6 +66,5 @@ // XACARS Route::group(['prefix' => 'xacars'], function () { - }); -}); \ No newline at end of file +}); diff --git a/routes/api/install.php b/routes/api/install.php index ac9a5b2f..15fd0b6b 100644 --- a/routes/api/install.php +++ b/routes/api/install.php @@ -1,4 +1,4 @@ isDot() && !$file->isDir() && $file->getFilename() != '.gitignore') - { - require_once $basepath.'/routes/web/'.$file->getFilename(); - } -} \ No newline at end of file +foreach (new DirectoryIterator($basepath.'/routes/web') as $file) { + if (! $file->isDot() && ! $file->isDir() && $file->getFilename() != '.gitignore') { + require_once $basepath.'/routes/web/'.$file->getFilename(); + } +} diff --git a/routes/web/web.php b/routes/web/web.php index b4b88128..eb8b70f6 100644 --- a/routes/web/web.php +++ b/routes/web/web.php @@ -17,12 +17,9 @@ Auth::routes(); - // // Pilot Center - - Route::group(['prefix' => '/staff', 'namespace' => 'AirlineStaff', 'middleware' => ['auth', 'App\Http\Middleware\AirlineStaffCheck'], 'as' => 'staff.'], function () { Route::group(['prefix' => '{airline}'], function () { Route::resource('/schedule', 'ScheduleController'); @@ -33,7 +30,7 @@ }); }); // System Admin -Route::group(['prefix' => '/admin', 'namespace' => 'Admin', 'middleware' => ['auth','App\Http\Middleware\AdminPerms'], 'as' => 'admin.'], function () { +Route::group(['prefix' => '/admin', 'namespace' => 'Admin', 'middleware' => ['auth', 'App\Http\Middleware\AdminPerms'], 'as' => 'admin.'], function () { Route::get('/', 'AdminController@index')->name('index'); Route::resource('/schedule', 'ScheduleController'); Route::resource('/fleet', 'FleetController'); @@ -66,4 +63,3 @@ return view('install.import'); }); Route::get('/accountmigrate', 'Admin\InstallController@migrate'); - diff --git a/server.php b/server.php index 5fb6379e..20bc389f 100644 --- a/server.php +++ b/server.php @@ -1,12 +1,10 @@ */ - $uri = urldecode( parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH) );