/** * Promocodes constructor. */ public function __construct() { $this->codes = Promocode::pluck('code')->toArray(); $this->length = substr_count(config('promocodes.mask'), '*'); }