Home / Snippets / How to Run Ziggy Generate On Laravel Forge Deployment
How to Run Ziggy Generate On Laravel Forge Deployment cover

How to Run Ziggy Generate On Laravel Forge Deployment

513

2 years ago

0 comments

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 build

Full 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 build

One thing to note, don't forget to check the Make .env variables available to deploy script.
Laravel Forge Deployment Script
notion avatar

Alaz

Week-end developer currently experimenting with web, mobile, and all things programming.

Topics:

Frontend

Resource

Average

Average

Support Us

If you like our tutorial, support us by being our Patreon or buy us some coffee ☕️

Welcome to PostSrc V3

PostSrc Dark Logo

You have to login to favorite this