laravel-auditing icon indicating copy to clipboard operation
laravel-auditing copied to clipboard

Error when implementing transformAudit

Open brunobacha opened this issue 11 months ago • 1 comments

Q A
Bug? yes
New Feature? no
Framework Laravel
Framework version 11.0.3
Package version 13.6"
PHP version 8.3.3

Steps to Reproduce

  1. Implement transformAudit()
<?php

namespace App\Models;

use App\Models\BaseModel;
use Illuminate\Support\Facades\Config;
use OwenIt\Auditing\Contracts\Auditable;

class AuditableModel extends BaseModel implements Auditable
{
    use \OwenIt\Auditing\Auditable;

    /**
     * {@inheritdoc}
     */
    public function transformAudit(array $data): array
    {
        $data['system_id'] = optional(Config::get('system'))->id;
        return $data;
    }

}
  1. composer update or php artisan package:discover --ansi
In Facade.php line 354:
                                   
  A facade root has not been set. 

brunobacha avatar Mar 15 '24 03:03 brunobacha

I couldn't reproduce the problem, maybe it is related to your environment or your implementation

parallels999 avatar Mar 15 '24 14:03 parallels999

Closed due inactivity

parallels999 avatar May 30 '24 14:05 parallels999