public function save($scan_after) { $server = Server::current(); $bucket = $server->bucket($this->bucket_name); $bucket->software = $this->software; $bucket->expire = $this->expire; $bucket->save(); // If we specified a scan after the bucket store, scan after if ($scan_after) { $server->scan(); } }
public function incoming() { Sdk::webhook('new_server_issues', function ($event) { $server_id = array_get($event, 'server_id'); // Check whether this webhook is meant for us or not. $current = Server::current(); if ($server_id !== $current->id) { return; } $this->updateComposer(); }); }