Skip to content

Instantly share code, notes, and snippets.

View rawilk's full-sized avatar

Randall Wilk rawilk

View GitHub Profile
@rawilk
rawilk / deploy-script.sh
Last active July 7, 2022 13:49
Laravel Forge "Zero-Downtime" Deployment
cd /home/forge
PROJECT_NAME="site-name"
PROJECT_REPO="git@github.com:github-username/repo-name.git"
RELEASES_KEPT=3
RELEASE=$(date +"%Y-%m-%d-%H-%M-%S")
# Reload PHP-FPM.
( flock -w 10 9 || exit 1
echo 'Restarting FPM...'; sudo -S service $FORGE_PHP_FPM reload ) 9>/tmp/fpmlock
@rawilk
rawilk / TwoFactorChallenge.php
Last active September 29, 2022 15:03
WebAuthn Key Authentication - Laravel WebAuthn Package
<?php
namespace App\Http\Livewire;
use App\Http\Requests\TwoFactorLoginRequest;
use Illuminate\Support\Arr;
use Illuminate\Support\Facades\Lang;
use Livewire\Component;
use Rawilk\Webauthn\Actions\PrepareAssertionData;
use Rawilk\Webauthn\Facades\Webauthn;
@rawilk
rawilk / RegisterWebauthnKey.php
Last active September 29, 2022 15:06
WebAuthn Key Registration - Laravel WebAuthn Package
<?php
use Illuminate\Support\Facades\Lang;
use Livewire\Component;
use Rawilk\Webauthn\Actions\PrepareKeyCreationData;
class RegisterWebauthnKey extends Component
{
/**
* This will be the public key credential options required for the front-end.