Skip to content

Commit

Permalink
Add Sources to ACARS Entries (#1905)
Browse files Browse the repository at this point in the history
* Add Sources to ACARS Entries

* Made changes based on feedback from Dispo

* Updated AcarsController to add API route to show supported sources and their ID

* Style fixes

* One more fix

* Fixes based on suggestions by nabeel.

* Rollback file

* Revert Changes

* Delete app/Models/AcarsSource.php

* fix charset

* StyleCI fix

* switch colaltion to charset
  • Loading branch information
BossOfGames authored Dec 6, 2024
1 parent a696cd1 commit 8dcc970
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class() extends Migration {
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('acars', function (Blueprint $table) {
$table->string('source', 5)->charset('latin1')->nullable();
});
}

/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('acars', function (Blueprint $table) {
$table->dropColumn('source');
});
}
};
4 changes: 2 additions & 2 deletions app/Http/Controllers/Api/AcarsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ public function acars_logs(string $id, LogRequest $request): JsonResponse

$count++;
} catch (QueryException $ex) {
Log::info('Error on adding ACARS position: '.$ex->getMessage());
Log::info('Error on adding ACARS log: '.$ex->getMessage());
}
}

Expand Down Expand Up @@ -336,7 +336,7 @@ public function acars_events(string $id, EventRequest $request): JsonResponse

$count++;
} catch (QueryException $ex) {
Log::info('Error on adding ACARS position: '.$ex->getMessage());
Log::info('Error on adding ACARS event: '.$ex->getMessage());
}
}

Expand Down
1 change: 1 addition & 0 deletions app/Models/Acars.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ class Acars extends Model
'autopilot',
'fuel_flow',
'sim_time',
'source',
'created_at',
'updated_at',
];
Expand Down

0 comments on commit 8dcc970

Please sign in to comment.