*/ #[Endpoint('Update server details', 'Updates a server name, owner, description, and external identifier.')] #[ResponseFromTransformer(ServerTransformer::class, Server::class, description: 'Server updated.', factoryStates: ['withRelationships'], resourceKey: 'server')] #[ExtensionFieldsParam] public function __invoke(UpdateServerDetailsRequest $request, UpdatesServerDetails $details, Server $server): array { $updated = $details->update( $server, $request->actionInput() ); Activity::event('admin:server.details') ->subject($updated) ->property('name', $updated->name) ->log(); return Fractal::item($updated) ->transformWith($this->getTransformer(ServerTransformer::class)->withExtensionFields()) ->toResponseArray(); } }