Check for departure airport restrictions #221

This commit is contained in:
Nabeel Shahzad
2018-03-30 11:08:53 -05:00
parent 35fb6f0e52
commit bd30b1f900
12 changed files with 189 additions and 29 deletions

View File

@@ -14,18 +14,21 @@ use Log;
*/
class InternalError extends ValidationException
{
protected const FLASH_FIELD_NAME = 'internal_error_message';
public const FIELD = 'internal_error_message';
public const MESSAGE = '';
/**
* InternalError constructor.
* @param string|null $message
* @param null $field
*/
final public function __construct(string $message = null, $field = null)
public function __construct(string $message = null, $field = null)
{
Log::error($message);
$validator = Validator::make([], []);
$validator->errors()->add($field ?? static::FLASH_FIELD_NAME, $message);
$validator->errors()->add(
$field ?? static::FIELD,
$message ?? static::MESSAGE);
parent::__construct($validator);
}