Added Notifications

This commit is contained in:
2026-05-21 22:52:16 +10:00
parent 10d6ee8dee
commit 150c34bfb8
14 changed files with 161 additions and 107 deletions
@@ -0,0 +1,15 @@
<?php
namespace App\Http\Controllers\Api;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Storage;
class AircraftApiController extends Controller
{
public function getLivery(string $aircraftDesignator){
$path = "images/livery_templates/{$aircraftDesignator}.png";
return $this->imageIfExists($path);
}
}
@@ -49,21 +49,8 @@ class AirlineApiController extends ApiController
public function getLivery(string $airlineInternalName, string $aircraftDesignator){
$path = "images/liveries/{$airlineInternalName}_{$aircraftDesignator}.png";
$cacheLimit = 60 * 60 * 72;
if(!Storage::disk('local')->exists($path)){
return response()->json(['error' => 'Livery not found'], 404);
}
$fullPath = Storage::disk('local')->path($path);
$lastModified = filemtime($fullPath);
return response()->file($fullPath, [
'Content-Type' => 'image/png',
'Cache-Control' => 'public, max-age='.$cacheLimit, // 24 hours
'Last-Modified' => gmdate('D, d M Y H:i:s', $lastModified) . ' GMT',
'ETag' => md5($path . $lastModified),
]);
return $this->imageIfExists($path);
}
function parseAirlineData(Airline $airline){