Check if target is not null to retrieve the proper data
This commit is contained in:
parent
9d94bd6567
commit
0d860c0b72
1 changed files with 6 additions and 2 deletions
|
@ -93,9 +93,13 @@ trait Loggable
|
||||||
{
|
{
|
||||||
$settings = Setting::getSettings();
|
$settings = Setting::getSettings();
|
||||||
$log = new Actionlog;
|
$log = new Actionlog;
|
||||||
|
|
||||||
|
if($target != null){
|
||||||
$log->target_type = get_class($target);
|
$log->target_type = get_class($target);
|
||||||
$log->target_id = $target->id;
|
$log->target_id = $target->id;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
if (static::class == LicenseSeat::class) {
|
if (static::class == LicenseSeat::class) {
|
||||||
$log->item_type = License::class;
|
$log->item_type = License::class;
|
||||||
$log->item_id = $this->license_id;
|
$log->item_id = $this->license_id;
|
||||||
|
|
Loading…
Add table
Reference in a new issue