Fixes and cleanup for user pending/registration calls

This commit is contained in:
Nabeel Shahzad
2017-12-22 16:32:21 -06:00
parent 81ac281d9f
commit babdca627e
16 changed files with 237 additions and 60 deletions

View File

@@ -12,7 +12,6 @@ namespace App\Models\Enums;
/**
* Class EnumBase
* @package App\Models\Enums
* TODO: Implement lang translations for enum labels
*/
class EnumBase
{
@@ -29,4 +28,17 @@ class EnumBase
return trans(static::$labels[$value]);
}
}
/**
* Return all of the (translated) labels
*/
public static function labels()
{
$labels = [];
foreach(static::$labels as $key => $label) {
$labels[$key] = trans($label);
}
return $labels;
}
}

View File

@@ -57,6 +57,10 @@ class User extends Authenticatable
'balance' => 'double',
];
public static $rules = [
];
public function getPilotIdAttribute($value)
{
$length = setting('pilots.id_length');