diff --git a/CHANGELOG.md b/CHANGELOG.md index a769087..9849b14 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,10 +6,10 @@ All notable changes to `laravel-settings` will be documented in this file ### What's Changed -- Bump creyD/prettier_action from 4.2 to 4.3 by @dependabot in https://github.com/rawilk/laravel-settings/pull/15 -- Bump aglipanci/laravel-pint-action from 2.1.0 to 2.2.0 by @dependabot in https://github.com/rawilk/laravel-settings/pull/17 -- Add Laravel 10.x Support by @rawilk in https://github.com/rawilk/laravel-settings/pull/18 -- Add Php 8.2 compatibility by @rawilk in https://github.com/rawilk/laravel-settings/pull/19 +- Bump creyD/prettier_action from 4.2 to 4.3 by @dependabot in https://github.com/rawilk/laravel-settings/pull/15 +- Bump aglipanci/laravel-pint-action from 2.1.0 to 2.2.0 by @dependabot in https://github.com/rawilk/laravel-settings/pull/17 +- Add Laravel 10.x Support by @rawilk in https://github.com/rawilk/laravel-settings/pull/18 +- Add Php 8.2 compatibility by @rawilk in https://github.com/rawilk/laravel-settings/pull/19 **Full Changelog**: https://github.com/rawilk/laravel-settings/compare/v2.2.1...v2.2.2 @@ -17,10 +17,10 @@ All notable changes to `laravel-settings` will be documented in this file ### What's Changed -- Bump dependabot/fetch-metadata from 1.3.5 to 1.3.6 by @dependabot in https://github.com/rawilk/laravel-settings/pull/13 -- Bump aglipanci/laravel-pint-action from 1.0.0 to 2.1.0 by @dependabot in https://github.com/rawilk/laravel-settings/pull/10 -- Improve internal handling of the Context object on Settings service class -- Prevent decryption errors when checking if a value should be persisted or not on `set()` +- Bump dependabot/fetch-metadata from 1.3.5 to 1.3.6 by @dependabot in https://github.com/rawilk/laravel-settings/pull/13 +- Bump aglipanci/laravel-pint-action from 1.0.0 to 2.1.0 by @dependabot in https://github.com/rawilk/laravel-settings/pull/10 +- Improve internal handling of the Context object on Settings service class +- Prevent decryption errors when checking if a value should be persisted or not on `set()` **Full Changelog**: https://github.com/rawilk/laravel-settings/compare/v2.2.0...v2.2.1 @@ -28,7 +28,7 @@ All notable changes to `laravel-settings` will be documented in this file ### What's Changed -- Allow cache to be temporarily disabled (via `temporarilyDisableCache()`) +- Allow cache to be temporarily disabled (via `temporarilyDisableCache()`) **Full Changelog**: https://github.com/rawilk/laravel-settings/compare/v2.1.1...v2.2.0 @@ -36,9 +36,9 @@ All notable changes to `laravel-settings` will be documented in this file ### What's Changed -- Bump dependabot/fetch-metadata from 1.3.4 to 1.3.5 by @dependabot in https://github.com/rawilk/laravel-settings/pull/8 -- Bump actions/checkout from 2 to 3 by @dependabot in https://github.com/rawilk/laravel-settings/pull/9 -- Prevent non-strings from being unserialized or decrypted +- Bump dependabot/fetch-metadata from 1.3.4 to 1.3.5 by @dependabot in https://github.com/rawilk/laravel-settings/pull/8 +- Bump actions/checkout from 2 to 3 by @dependabot in https://github.com/rawilk/laravel-settings/pull/9 +- Prevent non-strings from being unserialized or decrypted **Full Changelog**: https://github.com/rawilk/laravel-settings/compare/v2.1.0...v2.1.1 @@ -46,13 +46,13 @@ All notable changes to `laravel-settings` will be documented in this file ### Added -- Feature: model settings by @rawilk in https://github.com/rawilk/laravel-settings/pull/7 +- Feature: model settings by @rawilk in https://github.com/rawilk/laravel-settings/pull/7 ### Changed -- Composer: Update doctrine/dbal requirement from ^2.12 to ^3.5 by @dependabot in https://github.com/rawilk/laravel-settings/pull/5 -- Bump creyD/prettier_action from 3.0 to 4.2 by @dependabot in https://github.com/rawilk/laravel-settings/pull/6 -- Drop official PHP 8.0 support +- Composer: Update doctrine/dbal requirement from ^2.12 to ^3.5 by @dependabot in https://github.com/rawilk/laravel-settings/pull/5 +- Bump creyD/prettier_action from 3.0 to 4.2 by @dependabot in https://github.com/rawilk/laravel-settings/pull/6 +- Drop official PHP 8.0 support **Full Changelog**: https://github.com/rawilk/laravel-settings/compare/v2.0.1...v2.1.0 @@ -60,39 +60,39 @@ All notable changes to `laravel-settings` will be documented in this file ### Updated -- Add support for Laravel 9.* -- Add support for PHP 8.1 +- Add support for Laravel 9.\* +- Add support for PHP 8.1 ## 2.0.0 - 2020-12-01 ### Breaking Changes -- Drop support for Laravel v6 and v7 -- Drop support for php 7 +- Drop support for Laravel v6 and v7 +- Drop support for php 7 ### Updated -- Add support for php 8 -- Update some of code base to use php 8 features +- Add support for php 8 +- Update some of code base to use php 8 features ## 1.0.3 - 2020-10-26 ### Fixed -- Fix bug with context being reset when saving ([#3](https://github.com/rawilk/laravel-settings/issues/3)) +- Fix bug with context being reset when saving ([#3](https://github.com/rawilk/laravel-settings/issues/3)) ## 1.0.2 - 2020-10-09 ### Fixed -- Wrap decrypting values in a try/catch to help prevent decryption errors when caching is used - [#2](https://github.com/rawilk/laravel-settings/issues/2) +- Wrap decrypting values in a try/catch to help prevent decryption errors when caching is used - [#2](https://github.com/rawilk/laravel-settings/issues/2) ## 1.0.1 - 2020-09-09 ### Added -- Add support for Laravel 8 +- Add support for Laravel 8 ## 1.0.0 - 2020-08-02 -- initial release +- initial release diff --git a/README.md b/README.md index 9b04812..2b20096 100644 --- a/README.md +++ b/README.md @@ -78,7 +78,7 @@ If you discover any security related issues, please email randall@randallwilk.de ## Alternatives -- [spatie/laravel-settings](https://github.com/spatie/laravel-settings) +- [spatie/laravel-settings](https://github.com/spatie/laravel-settings) ## Disclaimer diff --git a/docs/advanced-usage/custom-generators.md b/docs/advanced-usage/custom-generators.md index 6873b7b..2394307 100644 --- a/docs/advanced-usage/custom-generators.md +++ b/docs/advanced-usage/custom-generators.md @@ -31,30 +31,30 @@ use Illuminate\Support\Str; class CustomKeyGenerator implements KeyGenerator { protected ContextSerializer $contextSerializer; - + public function generate(string $key, Context $context = null): string { $key = strtoupper($key); - + if ($context) { $key .= $this->contextPrefix() . $this->serializer->serialize($context); } - - return $key; + + return $key; } - + public function removeContextFromKey(string $key): string { return Str::before($key, $this->contextPrefix()); } - + public function setContextSerializer(ContextSerializer $serializer): self { $this->serializer = $serializer; - + return $this; - } - + } + /** * This prefix is how we will determine that a database record has a context when * flushing/retrieving all settings from the setting drivers. @@ -93,8 +93,8 @@ class CustomContextSerializer implements ContextSerializer { if (is_null($context)) { return ''; - } - + } + return json_encode($context->toArray()); } } @@ -124,7 +124,7 @@ class CustomValueSerializer implements ValueSerializer { return json_encode($value); } - + public function unserialize(string $serialized): mixed { return json_decode($serialized, true); diff --git a/docs/api/settings.md b/docs/api/settings.md index c1181df..3fd4ce5 100644 --- a/docs/api/settings.md +++ b/docs/api/settings.md @@ -46,7 +46,7 @@ public function get(string $key, $default = null) ```php /** * Retrieve all stored settings. - * + * * @param array|string|null $keys Only return a subset of settings. * @return \Illuminate\Support\Collection */ @@ -123,7 +123,7 @@ public function flush($keys = null): void ```php /** - * Get the correct cache key for a given setting. + * Get the correct cache key for a given setting. * * @param string $key * @return string diff --git a/docs/basic-usage/basic-usage.md b/docs/basic-usage/basic-usage.md index b79c701..440c868 100644 --- a/docs/basic-usage/basic-usage.md +++ b/docs/basic-usage/basic-usage.md @@ -75,7 +75,7 @@ The collection of settings returned from this method will contain objects struct > {tip} The `original_key` property is set by settings to reflect the key that is used in the database. -> {tip} If you'd like to retrieve all settings that do not have a context, you may provide a `false` value for a context: `settings()->context(false)->all()` +> {tip} If you'd like to retrieve all settings that do not have a context, you may provide a `false` value for a context: `settings()->context(false)->all()` ## Flushing settings diff --git a/docs/basic-usage/model-settings.md b/docs/basic-usage/model-settings.md index 12e29a1..00db84f 100644 --- a/docs/basic-usage/model-settings.md +++ b/docs/basic-usage/model-settings.md @@ -72,6 +72,6 @@ class User extends Model If you are using soft-deletes on your model, you may need to disable this behavior as well, and manually flush the model's settings when you force delete it. -> {note} This will only work when the `ReadableKeyGenerator` is used. +> {note} This will only work when the `ReadableKeyGenerator` is used. For more information on the key generators, see [Custom Generators](/docs/laravel-settings/{version}/advanced-usage/custom-generators). diff --git a/docs/basic-usage/teams.md b/docs/basic-usage/teams.md index e55b3c7..7c74fdd 100644 --- a/docs/basic-usage/teams.md +++ b/docs/basic-usage/teams.md @@ -11,7 +11,7 @@ By default, teams are disabled, however you can easily enable them by setting th ## Enabling the Teams Feature > {info} These configuration changes must be made **before** running the migrations when first installing the package or when upgrading from v2. -> +> > If you have already run the migrations and want to upgrade your implementation, you can add a migration and copy the contents of the `add_settings_team_field` migration from the package > after you make the configuration changes below. @@ -32,7 +32,7 @@ If you want to use a custom foreign key for teams, you can also set it in the co ## Working with Teams Settings After implementing a solution for selecting a team on the authentication process (for example, setting the `team_id` -of the currently selected team on the **session:** `session(['team_id' => $team->id]);`), we can set the global `team_id` +of the currently selected team on the **session:** `session(['team_id' => $team->id]);`), we can set the global `team_id` from anywhere, but we recommend setting it in a middleware. Example Team Middleware: @@ -47,9 +47,9 @@ class TeamMiddleware public function handle($request, Closure $next) { if (auth()->check()) { - Settings::setTeamId(session('team_id')); + Settings::setTeamId(session('team_id')); } - + // Other custom ways to get the team id /* if (! empty(auth('api')->user())) { // `getTeamIdFromToken()` example of custom method for getting the set team_id @@ -57,7 +57,7 @@ class TeamMiddleware auth('api')->user()->getTeamIdFromToken() ); } */ - + return $next($request); } } diff --git a/docs/introduction.md b/docs/introduction.md index 49c7f45..c2c1ae4 100644 --- a/docs/introduction.md +++ b/docs/introduction.md @@ -30,7 +30,7 @@ settings('foo'); ## Alternatives -- [spatie/laravel-settings](https://github.com/spatie/laravel-settings) +- [spatie/laravel-settings](https://github.com/spatie/laravel-settings) ## Disclaimer diff --git a/docs/requirements.md b/docs/requirements.md index cd97e54..6f9e4fa 100644 --- a/docs/requirements.md +++ b/docs/requirements.md @@ -11,7 +11,7 @@ sort: 2 ## Version Matrix | Laravel | Minimum Version | Maximum Version | -| ------- | --------------- |-----------------| +| ------- | --------------- | --------------- | | 6.0 | 1.0.0 | 1.0.3 | | 7.0 | 1.0.0 | 1.0.3 | | 8.0 | 1.0.1 | 2.2.2 |