diff --git a/CHANGELOG.md b/CHANGELOG.md index bda9c89..66b6705 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,40 +7,47 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] -## [1.0.0] - 2023-09-16 +## [1.1.3] - 2023-11-12 ### Added -- Support `Config` feature. -- Support `Console` feature. -- Support `Database` feature. -- Support `Event` feature. -- Support `Log` feature. -- Support `Schedule` feature. -- Support `Queue` feature +- Adding `GetArrayString` function on config -### [1.1.0] - 2023-09-26 +## [1.1.2] - 2023-10-17 ### Added -- Support `Queue` feature with `Sync` and `Redis` drivers. +- Adding `GetInt`, `GetInt8`, `GetInt16`, `GetInt32`, `GetInt64` function on config. + +### Fixed + +- Ignore migrations if no migration or seeder files. -### [1.1.1] - 2023-10-04 +## [1.1.1] - 2023-10-04 ### Added - Support `Queue` feature with `RabbitMQ` driver. -### [1.1.2] - 2023-10-17 +## [1.1.0] - 2023-09-26 ### Added -- Adding `GetInt`, `GetInt8`, `GetInt16`, `GetInt32`, `GetInt64` function on config. +- Support `Queue` feature with `Sync` and `Redis` drivers. -### Fixed +## [1.0.0] - 2023-09-16 -- Ignore migrations if no migration or seeder files. +### Added + +- Support `Config` feature. +- Support `Console` feature. +- Support `Database` feature. +- Support `Event` feature. +- Support `Log` feature. +- Support `Schedule` feature. +- Support `Queue` feature +[1.1.3]: https://github.com/fwidjaya20/symphonic/compare/v1.1.2...v1.1.3 [1.1.2]: https://github.com/fwidjaya20/symphonic/compare/v1.1.1...v1.1.2 [1.1.1]: https://github.com/fwidjaya20/symphonic/compare/v1.1.0...v1.1.1 [1.1.0]: https://github.com/fwidjaya20/symphonic/compare/v1.0.0...v1.1.0 diff --git a/config/application.go b/config/application.go index 442208e..9fad88f 100644 --- a/config/application.go +++ b/config/application.go @@ -3,6 +3,7 @@ package config import ( "log" "os" + "strings" "github.com/spf13/cast" "github.com/spf13/viper" @@ -73,6 +74,16 @@ func (app *Application) GetString(name string, defaultValue ...string) string { return cast.ToString(app.Get(name, defaultValue)) } +func (app *Application) GetArrayString(name string, delimiter string, defaultValues ...string) []string { + str := app.GetString(name, "") + + if len(str) == 0 { + return defaultValues + } + + return cast.ToStringSlice(strings.Split(str, delimiter)) +} + func (app *Application) Inspect() any { return app.viper.AllSettings() }