Replace $allocation->toString() with $allocation->address (#1431)

This commit is contained in:
MartinOscar 2025-06-04 22:13:59 +02:00 committed by GitHub
parent ece732d9e5
commit e7a950ffcb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 6 additions and 11 deletions

View File

@ -77,7 +77,7 @@ class AllocationResource extends Resource
Activity::event('server:allocation.delete') Activity::event('server:allocation.delete')
->subject($allocation) ->subject($allocation)
->property('allocation', $allocation->toString()) ->property('allocation', $allocation->address)
->log(); ->log();
}), }),
]); ]);

View File

@ -32,7 +32,7 @@ class ListAllocations extends ListRecords
Activity::event('server:allocation.create') Activity::event('server:allocation.create')
->subject($allocation) ->subject($allocation)
->property('allocation', $allocation->toString()) ->property('allocation', $allocation->address)
->log(); ->log();
}), }),
]; ];

View File

@ -62,7 +62,7 @@ class NetworkAllocationController extends ClientApiController
if ($original !== $allocation->notes) { if ($original !== $allocation->notes) {
Activity::event('server:allocation.notes') Activity::event('server:allocation.notes')
->subject($allocation) ->subject($allocation)
->property(['allocation' => $allocation->toString(), 'old' => $original, 'new' => $allocation->notes]) ->property(['allocation' => $allocation->address, 'old' => $original, 'new' => $allocation->notes])
->log(); ->log();
} }
@ -87,7 +87,7 @@ class NetworkAllocationController extends ClientApiController
Activity::event('server:allocation.primary') Activity::event('server:allocation.primary')
->subject($allocation) ->subject($allocation)
->property('allocation', $allocation->toString()) ->property('allocation', $allocation->address)
->log(); ->log();
return $this->fractal->item($allocation) return $this->fractal->item($allocation)
@ -114,7 +114,7 @@ class NetworkAllocationController extends ClientApiController
Activity::event('server:allocation.create') Activity::event('server:allocation.create')
->subject($allocation) ->subject($allocation)
->property('allocation', $allocation->toString()) ->property('allocation', $allocation->address)
->log(); ->log();
return $this->fractal->item($allocation) return $this->fractal->item($allocation)
@ -148,7 +148,7 @@ class NetworkAllocationController extends ClientApiController
Activity::event('server:allocation.delete') Activity::event('server:allocation.delete')
->subject($allocation) ->subject($allocation)
->property('allocation', $allocation->toString()) ->property('allocation', $allocation->address)
->log(); ->log();
return new JsonResponse([], JsonResponse::HTTP_NO_CONTENT); return new JsonResponse([], JsonResponse::HTTP_NO_CONTENT);

View File

@ -121,11 +121,6 @@ class Allocation extends Model
); );
} }
public function toString(): string
{
return $this->address;
}
/** /**
* Gets information for the server associated with this allocation. * Gets information for the server associated with this allocation.
*/ */