| Q | A
| ----------------- | ---
| Bug? | yes
| New Feature? | no
| Framework | Laravel
| Framework version | 5.5.45
| Package version | 4.1.4
| PHP version | 7.2.14
I have a Job that runs with Laravel scheduler ( php artisan schedule:run) that adds new rows on the database (Model::create([...]))
New rows are not reflected on the audits table.
New rows should be reflected on the audits table.
class MyModel extends Model implements AuditableContract
{
use Auditable;
...
class Kernel extends ConsoleKernel
{
/**
* Define the application's command schedule.
*
* @param \Illuminate\Console\Scheduling\Schedule $schedule
* @return void
*/
protected function schedule(Schedule $schedule)
{
$schedule->job(new DummyJob)->withoutOverlapping()->everyMinute();
...
php artisan schedule:runauditable table does not contain information about the new rows.
Do you have the audit.console config variable set to true in your config\audit.php file??
See the 'Console/CLI and Jobs' section in http://www.laravel-auditing.com/docs/9.0/troubleshooting
@Wol you are right. The console config was missing.
Thank you!
...
/*
|--------------------------------------------------------------------------
| Audit Console?
|--------------------------------------------------------------------------
|
| Whether we should audit console events (eg. php artisan db:seed).
|
*/
'console' => true, // <- here
];
Most helpful comment
@Wol you are right. The console config was missing.
Thank you!