Custom Code for Pilot IDents (#1398)
* Custom Code for Pilot IDents Adds a new setting to customize the ident or to use a fixed icao code in a multi airline environment. If settings is null/empty, airline icao will be used as like before. * StyleFix
This commit is contained in:
@@ -131,8 +131,9 @@ class User extends Authenticatable
|
||||
public function getIdentAttribute(): string
|
||||
{
|
||||
$length = setting('pilots.id_length');
|
||||
$ident_code = filled(setting('pilots.id_code')) ? setting('pilots.id_code') : optional($this->airline)->icao;
|
||||
|
||||
return optional($this->airline)->icao.str_pad($this->pilot_id, $length, '0', STR_PAD_LEFT);
|
||||
return $ident_code.str_pad($this->pilot_id, $length, '0', STR_PAD_LEFT);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user