@@ -5,9 +5,6 @@ namespace App\Models\Observers;
|
||||
use App\Models\Aircraft;
|
||||
use App\Support\ICAO;
|
||||
|
||||
/**
|
||||
* Class AircraftObserver
|
||||
*/
|
||||
class AircraftObserver
|
||||
{
|
||||
/**
|
||||
@@ -17,6 +14,10 @@ class AircraftObserver
|
||||
*/
|
||||
public function creating(Aircraft $aircraft): void
|
||||
{
|
||||
if (!empty($aircraft->airport_id)) {
|
||||
$aircraft->airport_id = strtoupper($aircraft->airport_id);
|
||||
}
|
||||
|
||||
if (empty($aircraft->hex_code)) {
|
||||
$aircraft->hex_code = ICAO::createHexCode();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user