Since we are using the audits table already in our project, is there any way to change the table name from "audits" to like "audit_trail_histories"?
Laravel auditing: change the default table name "audits"
1.1k Views Asked by Gemil Aguinaldo At
2
There are 2 best solutions below
2
On
http://www.laravel-auditing.com/docs/4.1/general-configuration
The Database driver allows modifying:
- The database connection.
- The table where the Audit records are stored.
.
return [ // ... 'drivers' => [ 'database' => [ 'table' => 'audits', 'connection' => null, ], ], // ... ];
Update the
up()anddown()methods in the migration file, so thataudit_trail_historiesis set as the table name.Execute
php artisan migrateto create the table.Update the configuration like so:
That's it!