app->singleton(function (): HashidsInterface { $config = $this->app->make(Repository::class); $length = filter_var($config->get('hashids.length', 0), FILTER_VALIDATE_INT); return new Hashids( $config->string('hashids.salt', ''), $length === false ? 0 : $length, $config->string('hashids.alphabet', 'abcdefghijkmlnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890') ); }); $this->app->alias(HashidsInterface::class, 'hashids'); } }