Skip to content

Releases: TimurTurdyev/Simple-Settings

v3.0.0

24 Feb 15:07

Choose a tag to compare

Breaking Changes

Migration: composite primary key replaces surrogate id

The id auto-increment column has been removed. (group, name) is now the primary key.

If you have already run the previous migration, apply this to your database:

-- MySQL / MariaDB
ALTER TABLE simple_settings
    DROP PRIMARY KEY,
    DROP COLUMN id,
    ADD PRIMARY KEY (group, name);

-- PostgreSQL
ALTER TABLE simple_settings
    DROP CONSTRAINT simple_settings_pkey,
    DROP COLUMN id,
    ADD PRIMARY KEY (group, name);

Fresh installations are not affected — just run php artisan migrate as usual.


Bug Fixes

  • SettingDeleted event now fires after the delete, not before — listeners no longer react to rows that may still exist due to a failed query
  • remove(?string $key) signature is now correctly nullable (was implicitly nullable, deprecated in PHP 8.1+)
  • SettingSetCommand: invalid JSON input now outputs a clear error message and returns FAILURE instead of silently storing null
  • Tests: explicitly set cache.default = array to work with Laravel 12's new default database cache driver

Improvements

  • persistSetting() now uses a single upsert() call instead of SELECT + INSERT/UPDATE
  • set(array $values) flushes cache once after all writes instead of once per key
  • loadMigrationsFrom() moved outside runningInConsole() — migrations are now available in all contexts (queued jobs, custom scripts)
  • Removed laravel/framework from require-dev — already pulled transitively by orchestra/testbench
  • New BaseCommand eliminates repeated app(SettingStorageInterface::class)->forGroup() across all Artisan commands
  • getMapWithKeys() simplified to a single mapWithKeys() call
  • CastsValue::valueToString() — merged identical array/object match arms
  • Removed redundant $guarded (shadowed by $fillable), redundant string casts, and manual updateTimestamps() call

Code Quality

  • Methods reordered in all classes for logical readability: group selection → read → write → cache → private helpers
  • README fully rewritten with complete API reference, all commands, events, validation, and schema docs

Tests

  • test_set_stores_timestamps_on_create — verifies created_at and updated_at are set on first write
  • test_set_updates_updated_at_but_preserves_created_at_on_overwrite — verifies created_at is immutable across updates

Поменяли название пакета

10 Dec 14:14

Choose a tag to compare

v1.0.7

wip: composer name change

v1.0.6

27 May 14:10

Choose a tag to compare

wip

Full Changelog: v1.0.5...v1.0.6

v1.0.5

27 May 13:43

Choose a tag to compare

wip

v1.0.4

27 May 13:35

Choose a tag to compare

wip

v1.0.3

27 May 13:33

Choose a tag to compare

wip

v1.0.2

27 May 13:31

Choose a tag to compare

wip

v1.0.1

27 May 13:21

Choose a tag to compare

wip

v1.0.0

27 May 13:15

Choose a tag to compare

wip