- What is cartalyst/settings used for?
- It is a framework-agnostic settings package that stores application configuration as key-value pairs in a database, so values can be changed at runtime without editing files or redeploying. The Laravel integration wraps that store in a simple API for reading and writing values from your app. Typical use cases are site-wide options, feature flags, and admin-editable configuration that non-developers need to change.
- How do I install cartalyst/settings in a Laravel app?
- Install it with composer require cartalyst/settings, then make sure the package service provider is registered (Laravel 5.5 and later auto-discovers it). Publish any config and migration assets the package ships, then run the migrations to create the settings table. Check the README for the exact provider class and publish tags for your installed version.
- How do I get and set settings values at runtime?
- The package exposes a small key-value API on its repository and facade, with methods for reading, writing, and removing a key. Reads typically accept a default so a missing key does not throw. Values are persisted to the database, so a read after a successful write returns the stored value. Verify exact method names and signatures in the README for your major version.
- Does cartalyst/settings support PHP 8 and modern Laravel versions?
- The 5.x line added PHP 8 support, which removes the package as a blocker for teams upgrading their runtime. Laravel version support is a separate constraint, so check the require block in the package's composer.json rather than assuming Laravel 10 or 11 works. Run composer why-not php 8.0 against your full dependency graph before committing to the upgrade. Keep the runtime upgrade and the Laravel upgrade as separate deployments so failures stay unambiguous.
- Is cartalyst/settings framework agnostic or Laravel only?
- The core is framework agnostic, and the Laravel service provider and facade are layered on top of it. In a non-Laravel PHP project you can use the underlying repository directly as long as you wire up a database connection. In Laravel you would normally use the provided integration instead of instantiating the store yourself.
- How do I publish the config and run the migrations for cartalyst/settings?
- Use php artisan vendor:publish with the package's tag to copy the config file and migration into your application, then run php artisan migrate. Publishing lets you control the table name and which database connection is used. If your version does not ship publishable assets, copy the migration from the package's database directory instead.
- Are there performance concerns reading settings from the database?
- Every read can become a database query, so calling get inside loops or on hot paths will add up quickly. Load the settings you need once per request, or cache the values with Laravel's cache and invalidate that cache after writes. The package makes no performance guarantees, and PHP 8's JIT will not meaningfully change an I/O-bound Laravel request, so do not justify an upgrade on speed.
- How do I test code that depends on cartalyst/settings?
- Because the store is database backed, point your tests at an in-memory SQLite connection and use RefreshDatabase, then seed the keys your code expects in setUp. If your own code depends on an interface, bind a fake implementation in the container instead of hitting the real table. Assert on observable behavior rather than on raw rows so the tests survive internal changes.
- What are good alternatives to cartalyst/settings?
- Spatie's laravel-settings gives you typed settings classes with built-in caching and a larger ecosystem, while simpler projects often just use a JSON column or a config writer. Choose based on whether you need typed classes, per-tenant scoping, or a plain key-value store. Cartalyst's package is the smallest of the options but has a correspondingly smaller community.
- Is cartalyst/settings still maintained and safe for production?
- Cartalyst packages historically move slowly, and a release headlined by PHP 8 support suggests the project follows runtime changes rather than shipping frequent features. Check the GitHub releases and issue tracker for recent activity, and confirm which PHP versions currently receive fixes. Pin an exact version, watch for a future major that drops older PHP, and plan that breaking change rather than this compatibility release.