GitHub Host key verification failed

As I came into work this morning I went to pull from GitHub and hit the error:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
SHA256:randomchars.
Please contact your system administrator.
Add correct host key in /Users/username/.ssh/known_hosts to get rid of this message.
Offending RSA key in /Users/username/.ssh/known_hosts:1
Host key for github.com has changed and you have requested strict checking.
Host key verification failed.
fatal: Could not read from remote repository.

Turns out GitHub had discovered that GitHub.com’s RSA SSH private key was briefly exposed in a public GitHub repository and more details are in their announcement:

The fix was easy, and I just removed the “GitHub” line from .ssh/known_hosts so it was regenerated. But you can also follow along in that article for updating it manually.

Display the query from a Filament Table

I’ve been playing around with Laravel Filament Tables and as I was building a really complex table with multiple filters, I noticed that I wanted to see what the query being generated was. So I hacked together a little thing to show it:

If, for some reason, you ever wanted to do this, I added a “getDebugSqlProperty” method on the Livewire Component that was taken from this tweet:

public function getDebugSqlProperty(): string
{
    return array_reduce($this->getFilteredTableQuery()->getBindings(), function ($sql, $binding) {
        return preg_replace('/\?/', is_numeric($binding)
            ? $binding
            : "'".$binding."'", $sql, 1);
    }, $this->getFilteredTableQuery()->toSql());
}

Then in the view call this Live computed property like this:

<pre><code>{{ $this->debugSql }}</code></pre>

Happy hacking!