I have a model that has the created_at column but doesn't have the updated_at column.
To continue using laravel timestamp only in created_at I set the constant UPDATED_AT to null in the model.
...
class MyModel extends Model implements \OwenIt\Auditing\Contracts\Auditable {
use \OwenIt\Auditing\Auditable;
const CREATED_AT = 'created_at';
const UPDATED_AT = null;
...
}
The problem is when I add the auditable to the model with timestamps=true in the auditable's config.
...
/*
|--------------------------------------------------------------------------
| Audit Timestamps
|--------------------------------------------------------------------------
|
| Should the created_at, updated_at and deleted_at timestamps be audited?
|
*/
'timestamps' => false,
im receiving an warning like that
<warning> DEPRECATED </warning> explode(): Passing null to parameter #2 ($string) of type string is deprecated in vendor\laravel\framework\src\Illuminate\Collections\Arr.php on line 281.
Actual Behaviour
I have a model that has the created_at column but doesn't have the updated_at column.
To continue using laravel timestamp only in created_at I set the constant UPDATED_AT to null in the model.
The problem is when I add the auditable to the model with timestamps=true in the auditable's config.
im receiving an warning like that
I found the problem here...
https://github.com/owen-it/laravel-auditing/blob/f7da93ef11a28a6dc656168d0479a37bd3843b59/src/Auditable.php#L114 The value of $this->excludedAttributes is:
Expected Behaviour
An execution without any warning
Steps to Reproduce
Already mentioned
Possible Solutions
Filter the array of excluded attributes to avoid null values;