Back to blog
Integration5 min1,581 reads

How to Add a 360° Product View on Laravel

3 steps for Laravel: publish in Studio, @push widget.js on the Blade product show view, bind by SKU. Lazy load, modal, CDN.

IntegrationHow-to
Laravel product page opening Spinnify 360° viewer in a modal overlay

Quick answer

360° on Laravel: publish in Studio (name = SKU, Active) → @stack('scripts') in the Blade layout head, @push widget.js on the product show view with {{ $product->sku }} → data-key + data-sku (AUTO if JSON-LD sku exists; URL if Livewire/Inertia stacks do not re-run). Lazy load and modal. Test a live product page, not a listing.

Laravel galleries flip still photos. Shoppers still cannot turn the item. You can add a photographed 360° spin without a Composer package: host frames in Spinnify and paste one script.

This guide is for Laravel with Blade. The same widget.js snippet works on a product page as on other HTML sites. You do not install a Spinnify Composer package. Do not bundle widget.js into Vite app.js.

3 steps from photos to a live Laravel page

The work is the embed: one script on the product detail view, then a match to the catalog SKU.

1. Prepare in Spinnify Studio

Before you edit Blade views:

  • Sign up for Spinnify Studio.
  • Create a product and upload a photo series (24–36 frames, 4:3 for PC photos).
  • Important: the Studio product name must equal the Laravel SKU you output (spaces and hyphens matter; case does not).
  • Keep the product Active. A hidden product will not show the button.

2. Add code on Laravel

Two ways to paste the same Studio snippet. Copy it from Widget installation → Show code.

Method A: Blade @stack (fastest for the whole catalog). In resources/views/layouts/app.blade.php put @stack('scripts') inside <head>. widget.js uses defer, so head is correct. On products/show.blade.php wrap the snippet in @push('scripts') … @endpush with data-sku="{{ $product->sku }}". Do not paste this on the listing (index.blade.php). Do not import widget.js in Vite app.js; keep the CDN script URL.

Method B: AUTO or URL. Use data-sku="AUTO" when the product Blade already prints Schema.org Product JSON-LD with a sku. If the page is Livewire or Inertia and stacks do not re-run after the first full load, use data-sku="URL" and set the Site base URL in Widget settings.

Spinnify widget.js pasted in a Laravel Blade @push on the product show view
widget.js in Blade @push → 360° modal.

3. Configure the binding

The code looks like: <script src="https://www.spinnify.io/widget.js" data-key="YOUR_WIDGET_KEY" data-sku="{{ $product->sku }}" defer></script>

  • data-key: your Studio widget key. Do not change it.
  • data-sku: {{ $product->sku }}, or AUTO to read sku from JSON-LD, or URL if Livewire/Inertia stacks do not re-run (save the page path in Studio).

Why it stays fast

A third-party script on a Laravel product view raises PageSpeed questions because Blade already paints the gallery and layout CSS. Spinnify keeps the extra work off first paint: frames stay on the CDN until someone asks to spin. Your Blade gallery still renders first; the 360 layer opens in a modal after the click.

  • Lazy loading: the browser does not fetch the frame set until the shopper clicks.
  • Isolation: the viewer opens in a modal and does not replace the Laravel gallery on first paint.
  • CDN: frames are resized WebP/AVIF, not extra files in Laravel storage.

Checklist: button not showing?

If the 3D View button is missing, walk this list on a live product URL, not in admin preview.

  • Is @stack('scripts') in the layout <head>? @push does nothing without it. If views are compiled, run php artisan view:clear.
  • Are you on the product show view? Do not load the script on index.blade.php.
  • Do names match? Studio product name and the SKU you output must match (spaces and hyphens included).
  • Is the Studio product Active?
  • Is data-key copied from your account?
  • One script per page: do not paste the snippet twice.
  • Livewire or Inertia: if stacks do not re-run after the first load, switch data-sku to URL and set Site base URL in Widget settings. Do not add widget.js to Vite app.js.

Can I customize the button look?

Yes. Style the launcher in Studio, not in theme CSS. You can match the storefront without editing the product template:

  • Position: right, left, or center.
  • Colors and label to match the Laravel theme.
  • Format: round floating icon or slim tab.

After that, Laravel still serves the gallery. The 360° layer opens when someone asks for it.

Shoot spins: how to create a 360 view. Magento HTML stores: Magento 2 guide. Tilda Zero Block.

Frequently asked questions

Do I need a Composer package?
No. Paste widget.js from Spinnify Studio into a Blade @push. Spinnify does not ship a Composer package. Same script as other HTML sites. Do not bundle widget.js into Vite app.js.
Blade @stack/@push or AUTO?
@stack('scripts') in the layout plus @push on the product show view is fastest for every product page, especially with {{ $product->sku }}. AUTO when JSON-LD sku exists. URL when Livewire or Inertia does not re-run stacks.
What are data-key and data-sku?
data-key is your widget key from Studio. data-sku is {{ $product->sku }}, AUTO for JSON-LD sku, or URL for a saved page path when stacks do not re-run.
Will the script slow Laravel?
Frames download on click. The viewer runs in a modal. Delivery is WebP/AVIF via CDN, not extra Laravel storage files.
Why does the button not appear?
Add @stack in the layout head, open a live product show view, match Studio name to SKU, keep the product Active, check data-key, paste the script once. Use URL mode if Livewire or Inertia skips stacks.
Does Livewire or Inertia work?
@push runs on the first full page load. If the product page is a Livewire full-page component or an Inertia visit that does not re-run Blade stacks, use data-sku URL and the Site base URL in Widget settings. Same widget.js. No extra package.
Can I customize the button?
Yes, in Studio: position, colors, label, round icon or slim tab. Laravel theme CSS does not need to restyle the launcher.

Author

Spinnify Editorial

The Spinnify 360° Studio team — guides on 360° product spins, storefront integrations, and product page performance.

Tilda Zero Block page opening Spinnify 360° viewer in a modal overlay
Integration10 min1,543 reads

How to Add a 360° Product View on Tilda: A Guide for Store Owners

3 no-code steps: publish in Spinnify Studio, embed via T123 or Zero Block, bind by SKU. Lazy load, modal, WebP/CDN. Checklist if the button stays hidden.

IntegrationHow-to
Read article
Magento 2 product page opening Spinnify 360° viewer in a modal overlay
Integration5 min1,543 reads

How to Add a 360° Product View on Magento 2

3 steps for Magento 2: publish in Spinnify Studio, paste widget.js in HTML Head or Page Builder, bind by SKU. Lazy load, modal, CDN. Checklist if the button stays hidden.

IntegrationHow-to
Read article

Ready to publish your first 360° spin?

Create a product, upload frames, and embed the widget with one script snippet.

  1. Upload frames
  2. Embed script
  3. Go live
Try Spinnify 360° Studio free