model_scribe_logs table. Once these four steps are complete you can start adding the HasAuditLog trait to your models.
Install the Package
1
Require the package via Composer
Add ModelScribe to your project’s dependencies with the following command. Laravel’s package auto-discovery will register the service provider and
ModelScribe facade alias automatically — no manual registration is needed.2
Publish the configuration file
Publish the After running this command, a fully commented
model-scribe.php configuration file to your application’s config/ directory. This file is where you define drivers, named stores, retention policies, and global settings.config/model-scribe.php file will be created. You can adjust the default driver, database connection, table name, and retention settings here — or leave the defaults and rely on environment variables instead.3
Publish the database migration
Publish the migration stub that creates the
model_scribe_logs table. The file will appear in your database/migrations/ directory with a standard timestamp prefix.What columns does the migration create?
What columns does the migration create?
The published migration creates the following schema:
4
Run the migration
Create the Your database is now ready to receive audit log entries. Head to the Quickstart to add
model_scribe_logs table in your database by running the standard migrate command.HasAuditLog to your first model.Environment Variables
All of the most common configuration options can be set via environment variables in your.env file, so you don’t have to modify config/model-scribe.php directly.