Check if target is not null to retrieve the proper data

This commit is contained in:
Ivan Nieto Vivanco 2023-02-27 19:01:37 -06:00
parent 9d94bd6567
commit 0d860c0b72

View file

@ -93,8 +93,12 @@ trait Loggable
{
$settings = Setting::getSettings();
$log = new Actionlog;
$log->target_type = get_class($target);
$log->target_id = $target->id;
if($target != null){
$log->target_type = get_class($target);
$log->target_id = $target->id;
}
if (static::class == LicenseSeat::class) {
$log->item_type = License::class;