Added Notifications
This commit is contained in:
@@ -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){
|
||||
|
||||
Reference in New Issue
Block a user