userfrosting/sprinkle-core
Core sprinkle for the UserFrosting PHP framework, providing essential services like dependency injection, routing, database access, configuration, error handling, and shared utilities that other sprinkles build upon.
userfrosting/sprinkle-core to an existing UserFrosting 6 app with Composer. This is a UserFrosting sprinkle built on Slim 4 + Illuminate components, not a drop-in Laravel package.UserFrosting\Sprinkle\Core\Core is listed in app/sprinkles.json. The skeleton includes it; if you removed it, core services, middleware, migrations, and Bakery commands will not be wired.php bakery to see available commands, then php bakery migrate to create core tables. If you plan to use database sessions, this creates/uses the sessions table.vendor/userfrosting/sprinkle-core/config/ for default configuration (sessions, database, logs, cache, errors).vendor/userfrosting/sprinkle-core/src/ for services, middleware, and session handlers.vendor/userfrosting/sprinkle-core/schema/ for migrations.vendor/userfrosting/sprinkle-core/routes/ for core routes.database (see the core session config for the exact key), run php bakery migrate, then inject the session service into a controller and confirm reads/writes land in the sessions table. This is the same path you will use for multi-node deployments.app/config/ rather than editing vendor files. Sprinkle order in app/sprinkles.json controls merge precedence. Keep secrets in .env. Run php bakery clear-cache after config changes.Connection, session service, translator, renderer, and logger. In older or container-aware code, resolve through the container ($this->ci->get(...)), but keep that at the edges.schema/ directory using the schema builder, and run them with php bakery migrate. Treat core migrations as read-only; add your own tables/columns in your sprinkle.Accept header, so API and browser clients get appropriate responses.write() runs on every request.SessionUpdateTimestampHandlerInterface / updateTimestamp) or extend the core handler. A custom handler that only implements write() may stop receiving calls when session data is unchanged.sessions table still has the activity timestamp column expected by the handler (the default migration includes it). If you customized the table and removed that column, timestamp updates may fail or be skipped.touch() to update mtime without rewriting the file. Ensure the web/PHP user has permission to touch session files. On NFS or shared volumes, file mtime can be unreliable; prefer database or Redis sessions in those environments.php bakery clear-cache after changing session, database, or route configuration.app/config/.php bakery debug and the application log (commonly logs/userfrosting.log) first. Enable debug mode only locally. For session issues, inspect the configured handler, the sessions table or session directory, and whether the request is actually starting a session.composer update userfrosting/sprinkle-core, clear caches, and run php bakery migrate if any new migrations appear. The main behavioral change is fewer session writes, which is a performance win but can surprise code that relied on write-side effects.How can I help you explore Laravel packages today?