Repository navigation
Conversation
- PHP ^8.4, Laravel 12/13, Testbench 10/11, PHPUnit 11.5/12.5; branch alias dev-next-gen => 2.x-dev; Pint with the Javaabu rules; CI matrix with coverage from one leg and a leg without the optional packages - Drops anlutro/l4-settings: database, json and array stores behind a SettingsStore contract, cached with a version token per change - Setting::make()->default()->field() with calls forwarded to the stencil field; SettingsPage classes, inline pages and sections - settings() helper, Settings facade, typed getters, casts from the field, encrypted settings, file URLs - v1 helpers, config/defaults.php fallback, FakesSettings and SettingsUpdated kept; activity log is optional; settings:import-v1 Refs #1 Closes #2 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Workers check the settings cache version before each job (Queue::before) and Octane before each request, task and tick, and reload when another process changed a setting. Tested with an in-process worker and with a real queue:work process started through vendor/bin/testbench, both ways. Closes #4 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- SettingsForm: a stencil form class per page, filled with the current values, validated and saved by the schema; uploads replace (and delete) the old file; encrypted values never reach the browser and stay when left empty; live fields work through Route::stencil() - Route::settings() with prefix, name, middleware, guard and controller options; SettingsController overridable from config or the macro, with JSON responses for JSON requests - view_settings / edit_settings registered with javaabu/permissions, plus each page's own permission; SettingsPolicy on SettingsPage, overridable from config or Gate::policy() - Blade page with javaabu/forms nav tabs between pages - Tests for both guards, user models, permissions and overrides Refs #3, #8 Closes #9 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
settings::Settings/Edit renders the page's stencil schema with <StencilForm>, tabs between pages (@javaabu/forms NavTabs), the saved status and a read-only notice; SettingsNav and the types are exported as @javaabu/settings. settings.views picks blade or inertia; the Blade view is publishable and the React page can be overridden through manifest. Vitest renders the page from the props PHP sends (a fixture written by InertiaPagesTest); CI typechecks and tests it. Closes #3 Closes #8 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
lang/en.json and lang/dv.json for the page, the form, the notices and the permission descriptions, with a test that every __() string has a Dhivehi translation; page and Inertia tests in Dhivehi and RTL. Refs #7 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Setting::translatable() gives a value per language when translatable is installed and enabled: the page's form edits a never-saved JSON-translatable SettingsRecord, so stencil renders site_title_en / site_title_dv with translatable's rules; values are stored as a locale map and read in the current language with fallback. Without translatable it's a plain setting, and stored maps are still read in the app locale. Tested both ways locally against translatable's next-gen (with its javaabu/helpers requirement removed); the tests skip until it can be installed next to settings v2 (n4ff4h/translatable#11). Refs #10 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Docusaurus docs: introduction, requirements, installation, upgrading from v1, defining settings, reading and writing, settings pages (Blade and React), testing, configuration, stores and caching, queue workers and Octane, permissions, overriding, activity log, translatable settings, Dhivehi and RTL (with translations to review), API reference - llms.txt with the rules and every page; AGENTS.md and CLAUDE.md - Boost guideline and the javaabu-settings skill with references - README and CHANGELOG for v2 Closes #5 Closes #6 Closes #7 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Same as Queue::before(), without resolving the queue manager on every request. Refs #4 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
n4ff4h/translatable#11 dropped javaabu/helpers, so translatable v3 installs next to settings v2: it's in require-dev, the translatable tests run, and the "without optional packages" job removes it to test the other way. Closes #10 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
9 of 11 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
javaabu/settings v2.0
This is the next major of settings: you define each setting once, with javaabu/stencil, and it gets typed access, a settings page in Blade or Inertia React, and fresh values in queue workers. It was developed on the fork
n4ff4h/settings(branchnext-gen) and tracked in n4ff4h#12.What's in it
Setting::make('per_page')->default(20)->integer()->minValue(1)puts the default, the stencil field and the validation in one place. Settings are grouped intoSettingsPageclasses (or inline pages) andSections.Settings::define()covers settings that have no page.database(default),jsonandarraystores, plus custom drivers, replacing anlutro/l4-settings. Values are kept as JSON, so their types survive.php artisan settings:import-v1copies the v1 values across.settings()helper and theSettingsfacade cast values from the field (booleans, integers, floats, arrays, enums). Typed getters (settings()->integer('per_page')) throw on the wrong type. Settings can be encrypted, and file settings have URLs.queue:workprocess, both with the reload on and off.Route::settings([...])gives each page a form, validation, saving, uploads and live fields. You choose the prefix, name, guard and middleware.settings::Settings/Editwith<StencilForm>, shipped through javaabu/manifest; the components are exported as@javaabu/settings.view_settings,edit_settingsand per-page permissions are registered with javaabu/permissions.SettingsPolicycan be overridden. Any guard and user model works.->translatable(), one input per language). The activity log comes from spatie/laravel-activitylog, and encrypted values are never logged.llms.txt,AGENTS.md, and a Laravel Boost guideline and skill.Breaking changes (full list in
docs/upgrading.md)anlutro\LaravelSettings\Facades\SettingwithJavaabu\Settings\Facades\Settings; writes save immediately, so there's nosave(). anlutro'sconfig/settings.phpis replaced by v2's file of the same name.SettingsUpdated::$causeris any Eloquent model, and defaults to the authenticated user.Providers\EventServiceProvideris removed.get_setting(),default_setting(),set_file_setting(),reset_file_setting(),remove_prefix(),config/defaults.php,FakesSettingsandSettingsUpdated.Tests and CI
Before or after merging
CODECOV_TOKEN. On the fork the upload is rejected without it (Foundations: PHP 8.4 / Laravel 12+, CI matrix, coverage and codestyle n4ff4h/settings#1)."dev-next-gen": "2.x-dev") to"dev-main": "2.x-dev".Javaabu/settingsmain.composer.jsongets javaabu/forms, manifest, permissions and stencil from VCS repositories on theirnext-gen/mainbranches, and translatable fromn4ff4h/translatable. Switch to released versions once they're on Packagist.docs/advanced-usage/dhivehi-and-rtl.md.🤖 Generated with Claude Code