In this snippet you will learn how to run Ziggy Generate command on Laravel Forge. It's pretty simple and all you have to do is to have the command in the "Deployment Script".
# SSR
php artisan ziggy:generate --url="${APP_URL}"
npm run buildFull code example is as follows.
cd /home/forge/yoursite.com
git pull origin $FORGE_SITE_BRANCH
$FORGE_COMPOSER install --no-interaction --prefer-dist --optimize-autoloader
( flock -w 10 9 || exit 1
echo 'Restarting FPM...'; sudo -S service $FORGE_PHP_FPM reload ) 9>/tmp/fpmlock
if [ -f artisan ]; then
$FORGE_PHP artisan migrate --force
fi
# SSR
php artisan ziggy:generate --url="${APP_URL}"
npm run buildOne thing to note, don't forget to check the Make .env variables available to deploy script.